lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello Gé,


>


 local clock = os.clock


 function nfib(n)

     if n <= 1 then

         return 1

     else

         return 1 + nfib(n-1) + nfib(n-2)

     end

 end


 local start = clock()

 local r = nfib(32)

 local stop = clock();

 print(math.floor(r/(stop - start)))




This has nothing to do what i measured or find usefull in real life. In embedded scripting 

(as i have used it and seen)  you build up a huge universe of your own objects and then 

you need to call this many times from the Lua glue code.


You are doing functions calls without any OO behind. Thats not realistic. A serios problem is always to 

move from script<->C level. I'm was amazed to see how slow this is in many languages, including Java.


Lua maybe fast but it is slow compared to what is possible. With a lot of OO it is even slower. I consider 

this as a problem as long as i see that you can easily reduce a few hash tables accesses and conditional

checks. 


And for Gameing, Consoles are slow for everything else then Graphics. AFAIK none of the current consoles 

have all the branch prediction, speculative evaluation and out of order execution CPU cores that a normal

PC has. So each conditional is costing serious time. But hey, the last time i wrote a game was about two 

decades ago. I'm talking about my experience with OO Scripting in "Business" Applications.



-- 

 Best regards,                        emailto: scholz at scriptolutions dot com

 Lothar Scholz                        http://www.ruby-ide.com

 CTO Scriptolutions                   Ruby, PHP, Python IDE 's