Transcription of Lua Performance Tips
{{id}} {{{paragraph}}}
2 Lua Performance TipsRoberto IerusalimschyIn Lua, as in any other programming language, we should always follow the twomaxims of program optimization:Rule #1:Don t do #2:Don t do it yet.(for experts only)Those rules are particularly relevant when programming in Lua. Lua is famousfor its Performance , and it deserves its reputation among scripting , we all know that Performance is a key ingredient of program-ming. It is not by chance that problems with exponential timecomplexity arecalledintractable. A too late result is a useless result. So, every good program-mer should always balance the costs from spending resourcesto optimize a pieceof code against the gains of saving resources when running that first question regarding optimization a good programmeralways asks is: Does the program needs to be optimized? If the answer is positive (but onlythen), the second question should be: Where?
16 2 Lua Performance Tips the need for extra C libraries, the prototype serialized int egers using a few arithmetic operations to isolate each byte (conversion to b ase 256).
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}