Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Is there any way to tell how sim freindly a script is?

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-23-2006 16:22
Still learning and I have started putting llOwnersay in a few spots in a script to tell when I pass a certain point. I put in llGetFreeMemory to see how big it is with it's lists.

I don't even know if I know how to ask this part right. Is there a way to tell which of two script revisions is the most effecient sim resources wise? Which one is putting a bigger load on the simulator?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Tuach Noh
Ignorant Knowlessman
Join date: 2 Aug 2006
Posts: 79
09-23-2006 16:27
If you or someone you know owns a private island, they have access to debug tools which can tell you exactly how much runtime a script is consuming. This is by far the easiest and most definitive way.

Other than that, about all I know of is expanding the Simulator and Time bars on the "View Statistics" pane and trying to tell the difference in load between the two.

Perhaps there are other, better ways.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
09-23-2006 16:30
There are a couple of ways. One involves a very trusted friend who owns a sim and will make you an estate manger. You can then, I believe, determine the sim load directly, well in terms of time spent on your script per frame (I'm not 100% sure about this have never done it, but I think that's right).

The other... go find a void sim. Make sure you've got no scripted attachments on. Attach the object... you get a cruder but similar test number.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-23-2006 16:40
Yes it was the Island Tools that I had heard about that made me think of this. I will end up having to go the empty sim route.

Such a shame thou. I might end up feature requesting it. If they could somehow release that part of the island tools to all of us we could make better scripts.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
09-23-2006 18:25
From: Jesse Barnett
Such a shame thou. I might end up feature requesting it. If they could somehow release that part of the island tools to all of us we could make better scripts.

Well, it would certainly be nice if you could see maybe a total and the number for your OWN scripts. I wouldn't really care if you couldn't see the timing data for OTHER people's scripts.
Zeera Xi
Real Join Date: Mid '05
Join date: 21 Sep 2006
Posts: 54
09-24-2006 01:02
I requested the feature of being able to look at one's own script loads and timings to be able to make your scripts more sim friendly ages ago, but LL has never responded when it would be a very very important feature to scripters and LL bothways that would result in a more friendly SecondLife environment.
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
09-24-2006 03:16
intersting post thanks for the info :)
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-24-2006 03:27
From: Zeera Xi
I requested the feature of being able to look at one's own script loads and timings to be able to make your scripts more sim friendly ages ago, but LL has never responded when it would be a very very important feature to scripters and LL bothways that would result in a more friendly SecondLife environment.


And yet they have already partially implemented it by giving land owners the tools?
Guess it comes back down to money.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
09-24-2006 05:03
I think it comes to politics and time.

Phillip, rather famously, said in a Town Hall a few months ago that they'd be rolling out *some* of the island owner/estate manager tools to all. Some don't make sense... like applying your own textures and remapping the sim.

Later reaction from various people appears to make it clear this wasn't quite the plan... but we keep pestering Torley on the basis of it.

We're still waiting for it to happen, but now SL seems to be a in repair rather than big new features mode there is hope that some of these things might sneak on to the BLOTTD and actually get done. No promises, but hope for it at least.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-25-2006 00:10
Well I'd much rather they fix the problems than introduce any new features.
Tuach Noh
Ignorant Knowlessman
Join date: 2 Aug 2006
Posts: 79
09-26-2006 10:01
This could be a fix. If these tools became available grid-wide, a lot of problem-causing resident-created scripts might get noticed and/or fixed.

"Hey! My sim performance sucks!"
"What's the highest use script on your parcel?"
"Uh, it says my auto-orbit no-warning global-chat-listening constant-scanning security system is using 50% of the sim resources."
"Try disabling it."
"Wow, what a difference, thanks! I had no idea."

Yes, I know this is not realistic. (The last part would of course actually be "OHNOEZ! SL IS TEH SUCK! LL SCREWED SECURITY SCRIPT OWNERS! HAXX! HAXX!";)

But it is sure a nice dream that scripters might be able to earn bragging rights based on quantifiable measurements of the efficiency of their scripts.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-27-2006 00:31
I'd just like to be able to instrument a script somehow (llEnableProfiling, Debug menu option ... I dont care how!) and get something quantifyable back.
You cant optomise unless you can see where it needs it.
Fushichou Mfume
Registered User
Join date: 30 Jul 2005
Posts: 182
10-04-2006 07:59
If you don't have access to the debug estate tools (you must be an estate manager for these), here is a methodology for checking number of "active scripts" and "script time".

Note that even if you do have access to the debug estate tools, they will not see/measure the script time of *attachments* -- they only see rezzed objects. Most attachments can be rezzed on the ground to measure them, if you own them yourself, but this might not yeild true results for attachments that require your AV to be in a certain state (flight attachments, for example). The debug estate tools will never, ever see the script time/active scripts associated with attachments on other avatars on your estate, unfortunately. Somebody wearing the Souls of the Damned, for example (1032 active scripts, sheesh) can TP in and throw your sim over the top, and you'll have no idea who it is.

Also note that its not only the millisecond load of your script that matters. It's also the number of microthreads generated by the script(s). These are called "Active Scripts" in the stats window. An object with only one visible script in it might generate dozens of Active Scripts. A sim starts bogging down at 5500-6000 Active Scripts, regardless of the Script Time total of all the scripts. Remember, in more recent patches, LL changed the way script performance works in sims. If other non-script time load increases (images time, etc.), then the first thing to lose time slices are the scripts so all the scripts in the sim start performing more slowly. This is why in a crowded club, for example, all your scripts seem to perform much more slowly than in sims where there are only one or two people around.

-------------

1. Go find an island that is running zero scripts (or close to zero) and you're the only person on it. This can take some time but it's worth it.
2. Take off all of your scripted attachments.
3. Open the stats window. Check the current script time, which should hopefully be 0.0 - 0.1 if you're lucky and found a truly empty island.
4. Equip your scripted attachments (or rez your scripted objects one at a time and check the delta in the Active Scripts and also the delta in the Script Time.

Results for all common/popular AV attachments that I personally own a copy of and could test, verified Oct. 1 2006:

FUSHI's SCRIPT TESTING STATS

The first column lists the number of active scripts generated by some popular AV attachments. Remember, a sim starts bogging down at 5500-6000 active scripts. The second column indicates the total milliseconds (ms) of "Script Time" used by those items that are generally considered "too laggy". Linden Labs states in their debug tool for Estate Owners that if total Script Time exceeds 25ms, you should start removing scripts. As a general rule, many estate owners consider objects that objects that use 0.2ms of script time as borderline laggy. Anything that uses more than 0.2 ms is definitely laggy and should be worn/used only when necessary.

If there is no ms value shown in the following list, it means the object uses only 0.1 ms of script time or less, so these objects are generally "safe" to wear all the time without affecting a sim too much.


Scripts Device Name
------- -----------------------------------------
1 PersonalTeleportSystem
1 FlipTitle
1 Black Widow Holster
1 Rainbow Sphere
1 Altimeter HUD (Ord.Malaprop)
2 Age Scanner v1.1
2 New Resident Locator
3 [-KL-] Teleport Effects v1.4
4 Animated Vamp Fangs w/Vampire Lips(Xcite!)v1.5
8 Couples MultiAnimator v2d
9 C:SI Combat HUD
9 C:SI Inventory HUD
10 Chimera
11 BlogHUD
15 Wet Ikon Anim Override One.8
16 ZHAO

24 Secret-Agent HUD 3.5d (0.3 ms script time only when chatspy is deployed)
21 KDC chastity serie collar 1.2.1
24 KDC chastity serie cuffs (L&R)
27 Abranimations Electromagnetic Rail Gun 2.0
30 proTEC Shield
34 Archatek Dragon Katana (in hand)
36 Hiro Pendragon Colt .45 (0.2 ms script time)
40 Multi-Gadget v1.48.4 (0.2 ms script time)
40 Callahan Widowmaker (typical Jillian Callahan vehicle) (0.3 ms script time)
44 Black Widow (each) active in hand
50 Marlin XCV (typical Jon Marlin vehicle) (0.2 ms script time)
50 Marlin DBV (typical Jon Marlin vehicle) (0.3 ms script time)
54 Archatek Dragon Katana Sheath (0.2 ms script time)
55 aubreTEC Osiris HUD (only HUD) (0.5 ms script time)
54 Orbz Control 6.2.1 (0.3 ms script time)
57 Seburo Compact-eXploder (0.2 ms script time)

73 Ashes Jin-Geom Katana (in hand) (0.3 ms script time)
79 Musashi Black Rose Katana (in hand) (0.2 ms script time)
87 Archatek Flame Naginata (in hand) (0.3 ms script time)
96 Archatek Flame Naginata Sheath (0.4 ms script time)
153 Musashi Black Rose Katana Sheath (0.5 ms script time)
179 Ashes Jin-Geom Katana Sheath (0.7 ms script time)

211 aubreTEC Osiris (rezzed with HUD) (1.1 ms script time)
410 psiTEC (1.2 ms script time)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-04-2006 20:44
Fushichou. Thank you so much. That was a tremendous amount of usefull data you supplied. Finally found an empty island with 40 scripts and 0.1 ms and was able to start pulling stuff out and checking it.

I was mainly worried about a new teleportation HUD that I just scripted but the numbers look good. Actually I had to pile on 3 scripts to get the numbers to change from 0.1 to 0.2. So I am happy.

Hmmmmm Does anybody happen to know what are good or bad script fps numbers:

"Script Perf - Number of LSL opcodes being executed a second by the simulator. Note that this is the number of ACTUAL instructions executed in the last second, not the theoretical maximum opcodes/second. If your simulator is not running very many scripts, this number will be low even if performance is good. "
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Fushichou Mfume
Registered User
Join date: 30 Jul 2005
Posts: 182
10-05-2006 07:33
From: Jesse Barnett
Fushichou. Thank you so much. That was a tremendous amount of usefull data you supplied. Finally found an empty island with 40 scripts and 0.1 ms and was able to start pulling stuff out and checking it.

I was mainly worried about a new teleportation HUD that I just scripted but the numbers look good. Actually I had to pile on 3 scripts to get the numbers to change from 0.1 to 0.2. So I am happy.

Hmmmmm Does anybody happen to know what are good or bad script fps numbers:

"Script Perf - Number of LSL opcodes being executed a second by the simulator. Note that this is the number of ACTUAL instructions executed in the last second, not the theoretical maximum opcodes/second. If your simulator is not running very many scripts, this number will be low even if performance is good. "


From what I've been able to glean the from various conversations and documentation over the past year, only the Active Scripts number from the Stats window and the reported (or observed Script Time *per object* are meaningful indicators of the lag impact of a script. By "reported or observed" Script Time, I don't mean that aggregate number shown in the Stats window. I mean instead the time reported in the Estate Management's Debug > Top Scripts tool (if you have access to it) or else what you can observe by using that procedure I outlined previously.

The aggregate Script Time stat from the Stats Window is useless for various reasons, but mostly because it always changes as needed to give priority to the other "... Time" values so that the total sim time stays in the 22.3 ms range. If those other time values go up, for whatever reason, the sim *reduces* the Script Time value accordingly, effectively providing fewer time slices to all the scripts (thereby slowing down script performance across the sim). When there are very few other things going on in the sim, the Script time can creep up as high as 20ms, but as soon as AVs start moving around or TPing in (which causes things like Images Time to go up because of all the image data being fed to AVs), the Script Time will plummet.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
10-05-2006 09:38
I was actually searching awhile back to try and find a guide on how to make scripts as sim-friendly as possible.

I've had people tell me both ways regarding my ships...one person stating that they have remarkably low #'s, and another told me that one had over 1.0. My ships operate purely on touch for an llDialog which activates a listen that will turn itself off once you're done with the menu. The only other attributes that I know of that would cause lag are the normal flight scripts and timers involved (physics watcher, etc), and the linked messages involved with the menu choices.

Script time quoted by both people mentioned above was while the ship was just running and idle.
Dominic Webb
Differential Engineer
Join date: 1 Feb 2006
Posts: 73
10-05-2006 09:56
You could always try to vote for Prop: 2117 - Per-user script performance monitoring tools

Hey, I'm tryin'



- d.
_____________________
.sig space for rent.
Fushichou Mfume
Registered User
Join date: 30 Jul 2005
Posts: 182
10-05-2006 10:14
From: Tiarnalalon Sismondi
I was actually searching awhile back to try and find a guide on how to make scripts as sim-friendly as possible.

I've had people tell me both ways regarding my ships...one person stating that they have remarkably low #'s, and another told me that one had over 1.0. My ships operate purely on touch for an llDialog which activates a listen that will turn itself off once you're done with the menu. The only other attributes that I know of that would cause lag are the normal flight scripts and timers involved (physics watcher, etc), and the linked messages involved with the menu choices.

Script time quoted by both people mentioned above was while the ship was just running and idle.


I've seen this too and personally I think it's a bug in what happens to scripted object X when it's activated in a sim that is already busy handling a lot of scripts. This is why I stress the need to test in a relatively empty sim. Then you're getting good baseline numbers. For example, some simple "candle" objects that turn on/off with a touch I've seen go close to 1.0ms or over when touched while the sim is quite busy with 25-ish AVs around. Normally those candles run at like .003ms. It's not repeatable enough to document and bug report to LL; just a weird glitch I occasinally notice things like that. I don't know if the bug is with the reported time itself (and the 1.0-ish number is just inaccurate), or whether the script is somehow going bad in those instances and truly using up that many cycles.

In any event, testing in a relatively empty sim prevents this bug from happening and you can get accurate numbers.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
10-05-2006 11:55
From: Fushichou Mfume
The aggregate Script Time stat from the Stats Window is useless for various reasons, but mostly because it always changes as needed to give priority to the other "... Time" values so that the total sim time stays in the 22.3 ms range.


Whilst this is true, one of the elements, at least as originally stated was a void sim with no one else around. I've got my favourite... it usually runs total frame time about 5.0ms so it gives a fair amount of overhead for the testing. I'm not saying that using the estate manager tools isn't better, I said that at first too, but you can get some reasonable numbers from void sim method too.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Fushichou Mfume
Registered User
Join date: 30 Jul 2005
Posts: 182
10-06-2006 13:45
Ya there's an island I use that has only 7 "Active Scripts" on it and the total script time for the entire sim never goes above 0.1, and usually stays at 0.0 for long stretches at a time. This is a perfect environment for testing how laggy a particular object or AV attachment is, and is where I verified most of my stats in the list I included previously in this thread.