2016-05-04 22:20 GMT+02:00 Alexander Ilin <ajs...@yandex.ru>:
> Hello!
>   I have a question: but won't using lexical variables make the code fatter? 
> Are there any optimizations that would make the code that uses lexical 
> variables as optimal as the code that manipulates the stack directly? Because 
> I saw disassembly of what the rot word does, and it's pretty damn optimal. If 
> I do the same with lexical variables, will it be as optimal?
>
>   I guess what I'm trying to ask is this: lexical variables do make the code 
> more readable, but does that come with a performance price or not?

Since you always have the compiler and disassembler at hand in Factor,
you can easily check for yourself if using locals make any difference.
Using locals could possibly add a few extra MOV instructions if you
are using a lot of them. But these MOV instructions are incredibly
cheap so it makes no difference at all. I would be very surprised if
you were able to demonstrate a measurable speedup by replacing locals
with stack shuffling words.


-- 
mvh/best regards Björn Lindqvist

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to