These forums are CLOSED. Please visit the new forums HERE
How to measure lag? |
|
|
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
|
11-25-2007 23:58
Is there anyway to test scripts to measure their Lag factor? For instance we could write a script with a timer in it or virtually the same script using llMinEventDelay, how can we determine which is liable to cause the lease lag?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-26-2007 01:37
here is a neat little test script that is good for small pieces of code
http://wiki.secondlife.com/wiki/LSL_Script_Efficiency#How_Fast_Does_That_Code_Run I use a variation of it with the useful parts relocated to the touch _start event so it's easier to run multiple tests. for full scripts and truly empty (beta?) sim and the spript prefs # will give you a good idea how heavy a load a script runs... there are comparison lists floating around, comparing certain popular scripts by their prefs numbers. you could also try rezzing multiple copies and see when it has a noticeable effect on things like time dilation, which would work for physics items too... to test memory effeciency there's a few ways, but my favorite (and how I tested the mylist = (mylist=[]) + mylist + item is to keep loading it until the script has a stack/heap collision, with a ongoing count on operations...._____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-26-2007 03:01
Changing the event delay is one of those LSL features that just isn't used. It doesn't have much practical use. I know I've used it once for something but I don't remember what.
The operations that are the most expensive (requiring the most CPU time) involve searching datasets. Sensors are a good example. _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
11-26-2007 03:46
I use llMinEventDelay() to further delay control() and collision() events when they're not needed frequently.
For example; for a pair of wings detecting if an avatar is flying, I only really need the control() event every 0.4 seconds or so to have it reasonably responsive, since all it does is looks to see if the avatar is flying or not and respond accordingly (if wings aren't open, open them). _____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon 10gb DDR2 800mhz FB-DIMMS 4 x 750gb, 32mb cache hard-drives (RAID-0/striped) NVidia GeForce 8800GT (512mb) |
|
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
|
11-26-2007 04:14
Thanks everybody
|
|
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
|
11-27-2007 00:03
Why is llMinEventDelay() not used - is it laggier than a timer or unreliable - it seems to be just what I need unless it is unreliable.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-27-2007 01:13
Why is llMinEventDelay() not used - is it laggier than a timer or unreliable - it seems to be just what I need unless it is unreliable. what exactly is it you are trying to make minEventDelay do for you? raising it can slow down how often events fire, reducing sim load... and as such it has some useful potential, but I don't see a lot of potential for timer replacement with it, unless you are timing collsion or similar events, and even then it's not much different from using those functions normally _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
|
11-27-2007 05:55
I'm creating something like disco lighting where I can vary colour and lighting - ie. a period of soft lights interrupted by strobe effect - by selecting various patterns (controlled by a DJ) - hope this makes sense - initial idea was to put the patterns as a series of vectors etc. that are readable form a note card.
add: The parameters, eg. lighting, would be generated client side so I thought I could use this command to send the command to the client, wait the specified period then send the next command etc. etc. |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
11-27-2007 06:49
no, minEventDelay will only change how fast an event can trigger, it can't be used to trigger an event on it's own...
as for client side effects,target omega, texture anim, and a few others are what you want, but beware... it may not lag the sim, but some clients may have a very hard time with lots of it layered in.... peronally speaking, I'd avoid strobes and volumetric lighting.... the first never looks right in SL anyways, and the second makes it a pain in the rear to zoom or click on things, especially if they(the lights) are moving. just my 2$L _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
|
11-27-2007 12:53
Well that is the type of feedback I'm looking for - thanks for that
![]() |