Jump to content

Whatever happened to script limits?


You are about to reply to a thread that has been inactive for 1891 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So, I was just troubleshooting a sim, and looked at the top scripts. The person that complained to me about the sim performance, their name was on the top ten items. By herself, her script time was over .4ms. She was wearing nearly 700 scripts.

When I pointed this out to her, I was fed the typical line about having no choice, it's the only way to look good (it's not, I see plenty of people that look great with no more than two or three scripts).

That's when I found myself whatever happened to LL forcing script limits, to curb this bad behavior?

Anyone have any idea what happened to that?

Link to comment
Share on other sites

Careful what you read off your server.  I was recently banned from a sim because they said I was running over 1000 scripts.  I had on only 27 scripts, even went to a store that has a wall that displays the scripts that everyone is running and what the KB total is.  I had on only 27 scripts but I am still banned because the server was in error.

Link to comment
Share on other sites

I remember that thread. Was it ever established whether the "evidence" was from the sim directly or from a script-measuring script?

The sim itself (and hence, all script-measuring scripts) will have an inflated measure of script time when an avatar is newly arrived compared to steady-state, but I've not before heard of the script count being wrong at the sim level. I'd not be so surprised to see it misreported by script-measuring scripts.

Link to comment
Share on other sites

I haven't heard any word about script limits from LL in AGES. Who knows, maybe they figure all those obnoxious OMFG YOU HAVE TO LEAVE YOUR SCRIPTS ARE TOO HIGH devices will do the job. The idea that a person can't look good without running scripts is absurd unless you're talking about a male nudist event, then the scripts in their naughty parts and the huds that control them are a bit much. But really, who needs any scripts to "look good" other than those in an AO? And they are way more efficient than they used to be back in the day.

Link to comment
Share on other sites

I sent an IM and a note card asking politely for more information so I could contact LL but have heard nothing from them so I don't know where the info came from. And I had not just arrived on the sim, I had been there for over 20 minutes when someone said something about the “guy” that just came in with all the scripts. And then I got banned. I know I did not do anything wrong and the only person I know that was there knows it, best I can do.

Link to comment
Share on other sites

I am not a scripter.  But I have friends who dabble in the art.  And the trend that I seem to see, is to spend a lot of time and effort putting more and more functionality into fewer and fewer scripts.  

So, does this make sense automatically?  If some complicated SL functionality is executed using 10 scripts,  Does it automatically use less resources if the same function is accomplished with one ginormous script?  

A lot of scripts seem to spend a lot of time doing nothing at all.  And its possible to write a script that is constantly busy, busy, busy.  I can see how having 1000 scripts running is almost certainly worse than having 10, but I'm not so sure that having 10 scripts is necessarily worse than having 2.

Link to comment
Share on other sites

Yeah, actually, it's almost always better to combine functionality from many scripts into fewer. There are a few special cases where separate scripts are preferable for functionality, and other cases where combining the scripts can actually introduce inefficiencies, but in the vast majority of cases, the fewer, the better.

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

Link to comment
Share on other sites


Qie Niangao wrote:

 

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

That was something cool that I learned from a "Let's Lessen Lag" class - once a script activates a process that will never be used again (ie. no one is going to turn on/off the water in a fountain) that the script can be deleted and the process continues with less/no lag.  The instructor said there are likely thousands of objects in SL that fit this example that could be deleted.

Link to comment
Share on other sites

Actually there's a bug (when isn't there a bug in SL?) where if you take the script out the way you suggest, and make a copy of the object, the functionality is lost. Otherwise, I think we'd see more of those types of scripts deleted.

Link to comment
Share on other sites


Qie Niangao wrote:

Yeah, actually, it's almost always better to combine functionality from many scripts into fewer. There are a few special cases where separate scripts are preferable for functionality, and other cases where combining the scripts can actually introduce inefficiencies, but in the
vast
majority of cases, the fewer, the better.

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

You're making me think my script scale is not optimal. I'd read elsewhere that the number of scripts running did not matter so much as the memory used to support them. My script scale gives both a count and a memory usage, and gives me a fail if the memory used is over 3MB.

I've noticed that sometimes I'll get considerably under the 3MB limit even though I have more scripts than some outfits that break it. I just went inworld to check and the outfit I was wearing had 24 scripts and about 1MB, but I've seen script counts in the low hundreds that went way over the memory limit and some that didn't.

So which matters most? Memory usage or number of scripts? Or is it like everything else in SL (or RL, for that matter): it depends?

Link to comment
Share on other sites


Lucretia Brandenburg wrote:

I haven't heard any word about script limits from LL in AGES. Who knows, maybe they figure all those obnoxious OMFG YOU HAVE TO LEAVE YOUR SCRIPTS ARE TOO HIGH devices will do the job. The idea that a person can't look good without running scripts is absurd unless you're talking about a male nudist event, then the scripts in their naughty parts and the huds that control them are a bit much. But really, who needs any scripts to "look good" other than those in an AO? And they are way more efficient than they used to be back in the day.

You really have a point there.  Most penises are, probably by necessity, very heavily scripted. The trouble is that most of the best ones are not modifiable, whereas they used to be.  The one I used to have, which was one of the best, way back then, was mod (thanks Ishtara).  I could easily take the script out and wear a non-scripted version for nude events. Therefore, I didn't have a version of my junk that was too excessively heavy in script usage (it's heavy enough as it is, I'm sure =P).  Nowadays, all of the best mantool creators believe they need to make them non-modifiable... it's sad.

Anyway... to the topic at hand.. it may not be very fruitful to point out the effect that having so many scripts on your avatar has on another avatar.  I would suggest using the opportunity to point out how much better having a lower script count would be on their own personal experience in SL.  It wasn't until I realized what a difference it makes (to me, personally) that I whole-heartedly started paying attention to my script count.  Please remember that there are people that are much less informed than you... education is the key.

...Dres

Link to comment
Share on other sites


Dillon Levenque wrote:

So which matters most? Memory usage or number of scripts? Or is it like everything else in SL (or RL, for that matter): it depends?

I would have to imagine that memory usage is actually the culprit.  But most people aren't going to easily understand what that means whereas, cutting down on script usage might actually make things better.

I've been advocating to my sister, Grimmie, that she cut down on her script usage.. she has and it has made her SL better.  I didn't feel as if I had to go into the specifics of why it would make things better... she's never going to be the type of person that will monitor her memory usage.

In other words... I believe that lowering the number of scripts you're using will surely lower your memory usage.  It's a first step.  If you'd like to get into the memory usage of each and every script that you're wearing, as I have, then I think that's great and commend you for taking the initiative.  Most people will never get close to doing that and I can't say that I blame them... there are much more fun things to do.  Advocating for people lowering their script count makes more sense to me than advocating for people to monitor their memory usage.

...Dres

Link to comment
Share on other sites


Dillon Levenque wrote:

So which matters most? Memory usage or number of scripts? Or is it like everything else in SL (or RL, for that matter): it depends?

Memory usage is quite useless. Mono-compiled scripts allocate as much memory as they need dynamically within their limit of 64 KB. The LSL script profiling functions and also the script memory overview in the about land window always return the maximum memory limit instead of the actually used memory. So it's quite ludicrous to see all those crappy avatar memory usage denunciation boards where you end up in the top-5 with your Mono-compiled scripts that actually use less memory than those people running around in LSL2-compiled scripts.

Link to comment
Share on other sites


Czari Zenovka wrote:


Qie Niangao wrote:

 

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

That was something cool that I learned from a "Let's Lessen Lag" class - once a script activates a process that will never be used again (ie. no one is going to turn on/off the water in a fountain) that the script can be deleted and the process continues with less/no lag.  The instructor said there are likely thousands of objects in SL that fit this example that could be deleted.

That explains it!  I had a rotating object I yanked the script out of and it kept rotating.  I guess I'll have to pull it back into inventory and rerez it.

Link to comment
Share on other sites


Ansariel Hiller wrote:


Dillon Levenque wrote:

So which matters most? Memory usage or number of scripts? Or is it like everything else in SL (or RL, for that matter): it depends?

Memory usage is quite useless. Mono-compiled scripts allocate as much memory as they need dynamically within their limit of 64 KB. The LSL script profiling functions and also the script memory overview in the about land window always return the maximum memory limit instead of the actually used memory. So it's quite ludicrous to see all those crappy avatar memory usage denunciation boards where you end up in the top-5 with your Mono-compiled scripts that actually use less memory than those people running around in LSL2-compiled scripts.
 

Then, of course, there are people, like this, that understand it more intricately than I could ever hope to myself.

...Dres

Link to comment
Share on other sites

Hahaha! Actually it's really easy:

* LSL2 scripts always use 16 KB of memory, no matter how much they really need

* Mono-compiled scripts only use as much memory as they need, with 64 KB the limit

* The LSL profile functions and the script memory function inside the viewer always report 16 KB for LSL2 and 64 KB for Mono scripts.

This ends up in the ludicrous situation that a simple script that only prints "Hello World" and only uses a few bytes will show up as 16 KB if you compile it the "classic" way and 64 KB if you compile it as Mono. But if you compile it as Mono, it doesn't use 64 KB, but those few bytes instead. Those script memory tools always show 64 KB, no matter how much memory really is used.

Link to comment
Share on other sites


Perrie Juran wrote:

Czari Zenovka wrote:

Qie Niangao wrote:

 

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

That was something cool that I learned from a "Let's Lessen Lag" class - once a script activates a process that will never be used again (ie. no one is going to turn on/off the water in a fountain) that the script can be deleted and the process continues with less/no lag.  The instructor said there are likely thousands of objects in SL that fit this example that could be deleted.

That explains it!  I had a rotating object I yanked the script out of and it kept rotating.  I guess I'll have to pull it back into inventory and rerez it.

It's not that a script can start processes that continue after deletion of the script, it's that scripts can set prim properties, which are persistent. Beyond the properties listed in this wiki page, there is also llTargetOmega, a viewer side rotation that persists. That's what you encountered, Perrie. Here's a script that will stop the rotation of such a prim, then delete itself...

 

default {    state_entry() {        llTargetOmeta(<0.0, 0.0, 0.0>, 0.0, 0.0);        llRemoveInventory(llGetScriptName());    }}

 

Link to comment
Share on other sites


Gadget Portal wrote:

Actually there's a bug (when isn't there a bug in SL?) where if you take the script out the way you suggest, and make a copy of the object, the functionality is lost. Otherwise, I think we'd see more of those types of scripts deleted.

I've actually done that (it was the first question asked it class) and, in class as well as my own experiments on my builds, the functunality remains.  I built some items I use in my house that I have copied and given to others and the copies worked for my friends as well.  Obviously I'm not talking about using a scrubber script, just removing the script.

Link to comment
Share on other sites


Perrie Juran wrote:


Czari Zenovka wrote:


Qie Niangao wrote:

 

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

That was something cool that I learned from a "Let's Lessen Lag" class - once a script activates a process that will never be used again (ie. no one is going to turn on/off the water in a fountain) that the script can be deleted and the process continues with less/no lag.  The instructor said there are likely thousands of objects in SL that fit this example that could be deleted.

That explains it!  I had a rotating object I yanked the script out of and it kept rotating.  I guess I'll have to pull it back into inventory and rerez it.

If you want the item to completely stop rotatating and never rotate again, then use a script scrubber.  But that will totally delete all script functionality.  According to the instructor who taught the class to which I referred (who is a scriptor herself and makes her SL living selling scripts), once a script (in your case a rotating script) is placed in a prim the action becomes part of the prim's property attributes (or something like that) which is why the script itself can then be deleted.

As described above, any copies or re-rezzing of an item *still* maintains the property.  A SL bug was not mentioned in class unless it is relatively new. 

/makes note to rez one of my items with the script removed, take it back into inventory and send a copy to a friend to retest

Link to comment
Share on other sites


Madelaine McMasters wrote:

Perrie Juran wrote:

Czari Zenovka wrote:

Qie Niangao wrote:

 

One reason for this is that even a completely idle script that will never do anything ever again nonetheless continues to use some resources. For example, a script that once started some texture animation in a "water" prim and never again executes a single line of script code nonetheless uses script memory and, believe it or not, consumes some sim processing time: the script scheduler actually checks to see if this tiny, useless script has anything to do (any pending events) every time its turn comes around, just the same as some massive script in a tight timer loop. That checking is very, very fast, but still counts when there are lots of scripts running on the sim.

That was something cool that I learned from a "Let's Lessen Lag" class - once a script activates a process that will never be used again (ie. no one is going to turn on/off the water in a fountain) that the script can be deleted and the process continues with less/no lag.  The instructor said there are likely thousands of objects in SL that fit this example that could be deleted.

That explains it!  I had a rotating object I yanked the script out of and it kept rotating.  I guess I'll have to pull it back into inventory and rerez it.

It's not that a script can start processes that continue after deletion of the script, it's that scripts can set prim properties, which are persistent. Beyond the properties listed in
, there is also llTargetOmega, a viewer side rotation that persists. That's what you encountered, Perrie. Here's a script that will stop the rotation of such a prim, then delete itself...

 
default {    state_entry() {        llTargetOmeta(<0.0, 0.0, 0.0>, 0.0, 0.0);        llRemoveInventory(llGetScriptName());    }}

 

What she said. ^^ :matte-motes-big-grin:

Link to comment
Share on other sites


Czari Zenovka wrote:


Gadget Portal wrote:

Actually there's a bug (when isn't there a bug in SL?) where if you take the script out the way you suggest, and make a copy of the object, the functionality is lost. Otherwise, I think we'd see more of those types of scripts deleted.

I've actually done that (it was the first question asked it class) and, in class as well as my own experiments on my builds, the functunality remains.  I built some items I use in my house that I have copied and given to others and the copies worked for my friends as well.  Obviously I'm not talking about using a scrubber script, just removing the script.

So this turns out to be complicated enough to justify the "bug" label. If you take a copy into inventory of an object with such a prim property set, that property will be preserved when you rez the copy. If, however, you make a shift-drag copy in the Build tool, many such properties are not preserved... although it's often a surprise to me which ones are and which aren't. (It's not unpredictable: the same properties are and aren't, always, but I can never remember which are which.)

The thing about which is worse, memory or script count, is particularly germane to the subject of this thread. About the worst thing too many normal scripts can do to a sim is to use up so much memory that the server starts swapping to disk, at which point performance really tanks. So memory is critically important when that threshold is approached.

Unfortunately, as Ansariel explained, there's no way to know from the outside just how much of its 64K memory a Mono script is actually using. So, back when script limits seemed imminent, we got a shiny new script function that allows us to set a limit on the amount of memory a script will use, where that limit is exposed to external measurement, and would have determined whether a script fit within the parcel's or avatar's memory limit.

Because those parcel and avatar memory limits were never established, scripters very rarely bother to set a script limit below that maximum 64K. That's not just being lazy, it's being smart: setting a lower limit doesn't make the script actually use any less memory, so it doesn't benefit the sim in any way, and it's often difficult to be absolutely sure that a script's memory footprint will never exceed a limit (and crash as a result). There's no incentive for a scripter to shrink the margin of safety, nor spend a lot of time establishing that memory can never exceed a tighter bound than the full 64K.

Such an incentive would certainly have resulted from avatar and parcel script limits.

TL;DR: The lack of script limits on avatars and parcels may make for somewhat less efficient scripts, but more than that, it makes external measurement of script memory quite hopeless.

Link to comment
Share on other sites

I understand what you wrote but I am still not sure whether my script scale is useless or not. Just to be clear, I call it 'my' script scale because I bought it (for 0$L), not because I created it.

It counts the number of scripts I'm dragging around as well as [what, apparently, is the best guess as to] their total memory usage. Let's assume the number of scripts it reports is accurate. Without naming the creator of my scale (which I can't do even if I wanted to right now since I'm not inworld) is it possible that he or she has just used 64K as a default? If so, why would my memory usage show over 3MB with one collection of scripts but under for a different collection with as many or even more scripts?.

Even more to the point: if my script scale truly is useless, how does one make a real determination? The ratio of SL residents who are clueless about scripts to those who write scripts has to be close to 1000 to 1 if not greater. A lot of residents don't even know what scripts even are. What's the answer? How does a person know if he or she is causing a problem?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1891 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...