Interesting.  Thanks for that - I'd wondered about the speed difference, now I know what to do for those slow scripts!<div><br></div><div>Neil Canham<br><br><div class="gmail_quote">On Sat, Apr 23, 2011 at 11:20 AM, Jeff Kelley <span dir="ltr"><<a href="mailto:opensim@pescadoo.net">opensim@pescadoo.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I like physics. And I like colors.<br>
<br>
I scripted a blackbody spectrum in LSL for a science sim. It was reasonably<br>
fast, 1.8s for a 400 points spectrum (380 to 780 nm) including Planck's law<br>
computation, CIE to RGB colorspace mapping with gamma correction, display<br>
with osDynamicTexture.<br>
<br>
That was fast, but not enough in my mind. Real-time interaction should be<br>
in the 1/10s range, not the second.<br>
<br>
So I rewrote the thing in C#. The key was to get rid of all llFunctions,<br>
LSL lists and string handling functions, math functions, even building<br>
manually the drawlist instead of calling osDraw routines. Execution time is<br>
now in the 0.1-0.2s range.<br>
<br>
Running Opensim 0.7.0.2 + MONO on a MacMini server, 2.53GHz Core Duo, 4GB.<br>
<br>
LSL code:       <a href="http://pastebin.com/MxsivsKS" target="_blank">http://pastebin.com/MxsivsKS</a><br>
C# code:        <a href="http://pastebin.com/UR2gsnU7" target="_blank">http://pastebin.com/UR2gsnU7</a><br>
<br>
Nice!<br>
<br>
_______________________________________________<br>
Opensim-users mailing list<br>
<a href="mailto:Opensim-users@lists.berlios.de">Opensim-users@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-users</a><br>
</blockquote></div><br></div>