Difference between revisions of "User:Void Singer/Optimizations"

From Second Life Wiki
Jump to navigation Jump to search
m (cleanup)
(Orphaning page, content available elsewhere. DELETE ME)
 
Line 1: Line 1:
<div id="box">
Orphan Page, Delete ME <br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 03:29, 13 October 2010 (UTC)
== Coding Practices: Optimizations ==
<div style="padding: 0.5em">
This is a list of current coding optimizations and "hacks" I use in LSL and in examples
They are all [[LSL_Script_Efficiency#How_Fast_Does_That_Code_Run|tested]] personally
# when testing a function that returns -1 on NOT_FOUND
#* use (~test_function) -[eg. if (~llSubStringIndex( "abcdef", "t")){
#* instead of (test_function != -1) -[eg. if (llSubStringIndex( "abcdef", "t") != -1){
#* because it runs faster -[(!~test_function) also works for FOUND
# when testing a list for a specific single entry
#* use llListFindList( vLstBase, (list)"test" )
#* instead of llListFindList( vLstBase, ["test"] )
#* because it runs faster and smaller compiled -[eg. if (llListFindList( vLstBase, (list)"test" )){
# when incrementing counters or variables
#* use (++vIntCount)
#* instead of (vIntCount++) or (vIntCount += 1) or (vIntCount = vIntCount + 1)
#* because it runs faster
# When testing if/else conditions place true statement first if possible
#* use (test) or (test == value)
#* instead of (!test) or (test != value)
#* because it's clearer & faster
# [[LSL_Script_Efficiency|Other Useful Optimizations]]
</div></div>
 
<div id="box">
== Comments ==
<div style="padding: 0.5em">
Feel free to leave me a note on my [[User_talk:Void_Singer|User Talk]] page.
</div></div>

Latest revision as of 20:29, 12 October 2010

Orphan Page, Delete ME
-- Void (talk|contribs) 03:29, 13 October 2010 (UTC)