|
Eye Ree
Registered User
Join date: 8 Feb 2006
Posts: 9
|
09-03-2006 10:22
Say I have 10 linked prims. Each needs to do something every second or so. Which would result in less lag: one timer in the root prim that drives the others using link messages, or a timer in each?
What is the best way to measure the difference?
Thanks!
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
09-03-2006 10:30
if they need to be synced 1 timer and a broadcast message to all the prims @ once is the way to go
|
|
Eye Ree
Registered User
Join date: 8 Feb 2006
Posts: 9
|
09-03-2006 10:45
Thanks, but they don't need to be in sync. In fact, I don't want them in sync.
I can get the effect I want using one timer, link messages, and a "chance to do it" test using llFrand.
I can also get it using a bunch of timers with the same frequency and a "chance to do it" test.
I can also get it using a bunch of timers that get set to a different frequency using llFrand each time they fire.
The question is, which approach is inherently more laggy. Multiple timers or link messages?
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
09-03-2006 10:48
I would use 1 timer and broadcast as mentioned above.
Not only is it tidier - but it also keeps them acting together.
Say for example you have a controller script that drives everything and the other scripts DO each have their own timer.
You make a change in the controller and whilst it is running thru compile and initialisation etc the other scripts are still running - better to have it so that when the controller stops the rest stop and when it has finished initialisation and starts broadcasting the others start as well.
In my oppinion of course
|
|
Eye Ree
Registered User
Join date: 8 Feb 2006
Posts: 9
|
Experimental Evidence
09-03-2006 12:34
I did some experiments in an empty sim. I tried each of the three methods outlined above. I saw no difference in the sim FPS even when I had 1000+ active scripts.
Is looking at sim FPS the way to gage the impact a script may have on lag?
IPS jumped around a bit, but seemed to be in more or less the same range for each approach. Is there a way to log and average IPS over a period of time?
If there really is no difference, then I agree: going with a single controller is better.
|