Difference between revisions of "LSL Script Efficiency"

From Second Life Wiki
Jump to navigation Jump to search
(Removed factualy inaccurate material)
Line 1: Line 1:
{{LSL Header}}
{{LSL Header}}
==What is Efficiency==


<div id="box">
<div id="box">
<div style="padding: 0.5em 0.5em 1.5em">
== What is Efficiency ==
<div style="padding: 0.5em;">
 
PAGE UNDER CONSTRUCTION!
PAGE UNDER CONSTRUCTION!




Efficiency is how long it takes to run a script.


There are many ways to speed up scripts, such as using ++a instead of a++.


 
</div></div>
Efficiency is how long it takes to run a script. For example, it is faster to do <i>integer a = 3.1415926535 </i> than <i> integer a = PI. </i> This is because it takes to computer time to determine the value for PI, and then set it to a.
 
For a similar reason, there are many random ways to speed up scripts, such as using ++a instead of a++.
 
 
</div>
</div>
 
<div id="box">
<div id="box">
== Rules for posting ==
<div style="padding: 0.5em;">


== Rules for posting ==
The following code snipit will allow testing of a function.
The following code snipit will allow testing of a function.


Line 33: Line 29:
}
}
</pre>
</pre>
----


==Things that are faster==
</div></div>
 
<div id="box">
++a is the fastest
== Things that are faster ==
then there is a += 1
<div style="padding: 0.5em;">
finally a++
{{{2|}}}
</div></div>

Revision as of 18:24, 3 April 2007

What is Efficiency

PAGE UNDER CONSTRUCTION!


Efficiency is how long it takes to run a script.

There are many ways to speed up scripts, such as using ++a instead of a++.

Rules for posting

The following code snipit will allow testing of a function.

default {
  state_entry() {
    integer i = 0;
    while (i < 1) {
      ++a;
    }
  }
}

Things that are faster