i believe dan did some work on optimizing the timers. maybe he can give some insight...<br><br>--mic<br><br><br><div class="gmail_quote">On Fri, Dec 3, 2010 at 5:35 PM, Justin Clark-Casey <span dir="ltr"><<a href="mailto:jjustincc@googlemail.com">jjustincc@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I'm not familiar with the this area of the code but I had a quick look since I was curious (the meat is in OpenSim/Region/ScriptEngine/Shared/Api/Plugins/Timer.cs).  The code isn't using C# timers so I'm not totally surprised at the behaviour that you're seeing.<br>

<br>
I suspect addressing this would require a considerably different implementation.<div><div></div><div class="h5"><br>
<br>
On 03/12/10 17:18, Jorge Lima wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Ran 100 timer events with a single if(++i>  100) inside. I suppose<br>
decrementing and comparing to 0 might be faster, but I also<br>
copy-pasted 100 inlined if clauses and the time to run them was<br>
negligible.<br>
<br>
llSetTimerEvent(0.1) ->  59 s ->  490% overhead<br>
llSetTimerEvent(0.2) ->  59 s ->  195% overhead<br>
llSetTimerEvent(0.5) ->  59 s ->  18% overhead<br>
llSetTimerEvent(0.75) ->  81 s ->  8% overhead<br>
llSetTimerEvent(1.0) ->  108 s ->  8% overhead<br>
llSetTimerEvent(2.0) ->  209 s ->  4.5% overhead<br>
llSetTimerEvent(4.0) ->  407 s ->  1.75% overhead<br>
<br>
I am guessing that the overhead is, therefore, internal to the timer<br>
implementation. I haven't tested raw C# timers as comparison but 100ms<br>
is an eternity in modern computing, I can ping servers across the<br>
Atlantic ocean in less than that!<br>
<br>
I went through the code but I haven't yet found the part that handles<br>
timers. It's not in EventManager.<br>
Does anyone know what's going on? The code works fine in SL.<br>
Should I be posting this in the dev list? I'd like to see if I can fix it.<br>
Any thoughts on how to get fast timers in OpenSim?<br>
Faster computer? (I did check and was only getting about 20% CPU usage...)<br>
Porting them to a Real-Time operating system? :)<br>
_______________________________________________<br>
Opensim-users mailing list<br>
<a href="mailto:Opensim-users@lists.berlios.de" target="_blank">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>
<br>
</blockquote>
<br>
<br></div></div><font color="#888888">
-- <br>
Justin Clark-Casey (justincc)<br>
<a href="http://justincc.org" target="_blank">http://justincc.org</a><br>
<a href="http://twitter.com/justincc" target="_blank">http://twitter.com/justincc</a></font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Opensim-users mailing list<br>
<a href="mailto:Opensim-users@lists.berlios.de" target="_blank">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>
</div></div></blockquote></div><br>