Example: air traffic controller
Lua Performance Tips
x = x + math.sin(i) end return x end print(foo(10)) We can optimize it by declaring sin once, outside function foo : local sin = math.sin function foo (x) for i = 1, 1000000 do x = x + sin(i) end return x end print(foo(10)) This second code runs 30% faster than the original one. Although the Lua compiler is quite efc ient when compared wi th ...
Download Lua Performance Tips
Information
Domain:
Source:
Link to this page: