[Opensim-users] Scripting: 10x speed boost with C#
Karen Palen
karenpalensl at gmail.com
Mon May 2 19:19:36 UTC 2011
Is this really saying that compiled code executes math functions faster
than interpreted code?
I don't really see this as a language specific thing based on what you
are saying (although I am sure we all agree that LSL is a total mess
from a language design viewpoint).
The deeper question is where to go from here for OpenSimulator. Simply
dumping all the installed scripts would be far too painful - ask any
Cobol programmer - but hopefully we do not have to repeat past mistakes!
Karen
On 05/02/2011 05:11 AM, Jeff Kelley wrote:
> At 4:36 AM +0100 4/25/11, Justin Clark-Casey wrote:
>
>> Very interesting, Jeff. The scripting engine in OpenSim transforms LSL to C#
>> before compiling it so there wouldn't be a time difference due to
>> interpretation.
>>
>> Of course, I'm presuming that you had configured all LSL scripting delays down
>> to zero
>
> No, because I was not aware of that option.
>
> With ScriptDelayFactor = 0.0, the LSL version changes from an average of
> 2.15s to 2.10s. No big deal. The C# version is still around 0.2s.
>
> I switched to C# because i noticed my script spent most of its time into
> list handling (llList2Rot, which was a first speed gain over
> 4*llList2Float). Since LSL has no array structure, we use lists to emulate
> them and waste a lot of time here.
>
> Then, replacing llPow with System.Math.Pow gave me another speed boost.
> Finally, replacing osSetPenColour, osDrawLine with direct drawlist
> manipuations (drawList += ) accounted for the overall 10x speed increase.
>
> Of course, that depends a lot on your application. If you are manipulating
> prims, the gain may be near zero. If you do a lot of math and matrixes, it
> may be higher.
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
More information about the Opensim-users
mailing list