Babbage Linden asks: what can LL change in LSL to reduce lag?
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
12-03-2009 08:51
From: Argent Stonecutter I think this is a terminology issue. There are technical differences between callbacks and message-based event handlers, but they're subtle and in this context I'm sure an event was what was intended. Yup, just semantics, but it's such a good list, it would be best to use the right terminology to avoid confusion. Thus my suggesion for "notification", which doesn't imply any particular implementation.
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
12-03-2009 08:53
From: Argent Stonecutter There's a tradeoff. If you try to index on everything, you increase the cost of insertion, and you start having lag caused by adding and removing too many listens. Based on comments by Lindens, they have separate queues for channels but then after that they do explicit tests on each event, and I think even check on things like distance and key before they do the relatively expensive string comparisons. So if they were to use hashes they'd have to have a LOT of hashes, most of which would only have one entry.
Doesn't mean it wouldn't hurt to have a hash on channel zero, but I don't think it'd be an automatic win. You'd need to do tests. Agreed, and very good suggestion about possibly treating channel zero specially.
|
Shadowcat Tiger
Registered User
Join date: 30 Nov 2005
Posts: 16
|
12-03-2009 09:20
I wonder how much instrumentation is built into the SL servers and in particular how much lag good instrumentation would introduce. I've often wound up building systems which can have their instrumentation turned off for the prod version to avoid performance issues and wonder if LL has similar versions.
If so, how about having several test sims that are only used for testing and which are heavily instrumented and configurable. Perhaps there'd need to be a signup scheme or something so people could use them in a controlled environment.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-03-2009 15:43
From: Argent Stonecutter If they don't eliminate the flight ceiling completely people will still be using flight scripts, so there's really no savings from just increasing it. true, but if the height is increased drastically (say 204  it removes the need for most uses, still prevents idiot newbies from flying up to 1mil+ meters and "getting lost", and still provides a zone which is buildable but not flyable, for simple privacy. it also allows flying in the at non mapping heights so people can have their skybox in range and still not mapped  it won't absolutely limit use of flight assist, but make it's need so rare that most people wont bother. as for the AO, yeah, a "animation state" change event notification, that triggers on each new state start, but it really is best envisioned as a viewer side thing since that's the most likely stimulus response, the shortest path to change, and least impact to the grid. the problem is that it requires a different model of distribution, and scripting... although that could be a good thing, it might also be a security hole.
_____________________
| | . "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... | - 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-03-2009 17:36
From: Void Singer true, but if the height is increased drastically (say 204  it removes the need for most uses People will still wear them, starting with the first time they fall out of a skybox at 3000 meters. Because apart from flying to a skybox or "safety" when you're in one, there's no reason to wear one right now.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-03-2009 18:01
From: Argent Stonecutter People will still wear them, starting with the first time they fall out of a skybox at 3000 meters. Because apart from flying to a skybox or "safety" when you're in one, there's no reason to wear one right now. sure there is.... avoiding ground clutter and extra rezzing mess =)
_____________________
| | . "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... | - 
|
Ilana Debevec
Registered User
Join date: 25 May 2007
Posts: 130
|
12-03-2009 19:36
ok, couple of thoughts I've had in the back of my head for a while
lLinkParticleSystem(integer linknumber, list rules)
Works EXACTLY like the particle system does now, but the particles come from the prim specified by linknumber.
If you do any work with lighting effects, maybe fountains and the such, or the Lockmeister system... you have to have the script in every prim you want an effect from. I could eliminate a minimum of 6, in some cases 15-18 scripts out of some of my builds.
llEventIgnore( integer eventtype) (could use a better name)
llEventIgnore(LINK_MESSAGE) // this script doesn't have a link_message handler, don't wake me up to handle something I can't
llEventIgnore(COLLSION)
llEventIgnore(LISTEN)
llEventIgnore(TOUCH)
etc.. etc.. etc...
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
12-03-2009 19:59
/me likes the llLinkParticleSystem idea. From: Ilana Debevec llEventIgnore( integer eventtype) (could use a better name) I think LSL already does this internally.. I could be wrong, though.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-03-2009 20:00
From: Ilana Debevec llEventIgnore(LINK_MESSAGE) // this script doesn't have a link_message handler, don't wake me up to handle something I can't
If you don't have a link message handler, it shouldn't be waking you up anyway. That should be fixed in the event system if it is.
|
Ilana Debevec
Registered User
Join date: 25 May 2007
Posts: 130
|
12-03-2009 20:05
From: Argent Stonecutter If you don't have a link message handler, it shouldn't be waking you up anyway. That should be fixed in the event system if it is. I believe I read somewhere that the scripts got 'woke up' if there is a collision or listen or link message even if it didn't have a handler (specifically remember it on collisions).. I could be wrong, but might be worth looking into.
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
12-03-2009 20:13
Would being able to have lists of list be of any value?
That way, something like the suggested
lLinkParticleSystem(integer linknumber, list rules )
could be
lLinkParticleSystem( list linknumbers, list ruleslists )
which would allow you change the particle systems in multiple linked prims with distinct rule lists using one function call.
If lists of lists is not a good idea, then maybe
lLinkParticleSystem(integer linknumber, list rules )
could be
lLinkParticleSystems(list linknumbers, list stridedrules )
which would also allow changing multiple linked prim's particle systems with one call.
Or less useful but still maybe worthwhile
lLinkParticleSystems(list linknumbers, list rules )
which would apply the same one rule list to multiple linked prims with one call.
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-03-2009 20:17
From: Ilana Debevec I believe I read somewhere that the scripts got 'woke up' if there is a collision or listen or link message even if it didn't have one (specifically remember it on collisions).. I could be wrong, but might be worth looking into. If they do, that can be fixed without adding an LSL call to tell the event handler something it already knows. 
|
Ilana Debevec
Registered User
Join date: 25 May 2007
Posts: 130
|
12-03-2009 20:26
From: Argent Stonecutter If they do, that can be fixed without adding an LSL call to tell the event handler something it already knows.  You would think...but I have a feeling that .. well how shall I put this delicately... the LSL compiler is too stupid to bother to note that when it compiles the code (oh this one dosen't have a Listen, a Collision_* a Touch_* a Link_Message handler... ) so the event handler may well NOT know... but then Baggage could tell us better (and I'll go back in my little corner and play with my particles  )
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-03-2009 20:33
From: Ilana Debevec You would think...but I have a feeling that .. well how shall I put this delicately... the LSL compiler is too stupid to bother to note that when it compiles the code (oh this one dosen't have a Listen, a Collision_* a Touch_* a Link_Message handler... ) so the event handler may well NOT know... but then Baggage could tell us better (and I'll go back in my little corner and play with my particles  ) Not true. Events being handled change on state entry. Watch what happens to the touch in the pie menu as you switch between states with and without touch events.
|
Ilana Debevec
Registered User
Join date: 25 May 2007
Posts: 130
|
12-04-2009 00:56
From: Argent Stonecutter Not true. Events being handled change on state entry. Watch what happens to the touch in the pie menu as you switch between states with and without touch events. Ah.. ok, touch, yeah... but I'm unsure about the rest. Worth discussion I guess
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-04-2009 02:22
I don't see how it would be possible to make the event handler *work* if it didn't know the events handled on each state. Nor can I see what it would mean to "wake up" the script if there was no code to run.
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
12-04-2009 05:44
From: Ilana Debevec I believe I read somewhere that the scripts got 'woke up' if there is a collision or listen or link message even if it didn't have a handler (specifically remember it on collisions).. I could be wrong, but might be worth looking into. A script gets visited EVERY pass, even if it's in a state with no handlers, or just a state_entry handler. THAT's what really needs to be fixed, to reduce the cost of dormant scripts. Most sims are chock full of dormant scripts.
|
Shadowcat Tiger
Registered User
Join date: 30 Nov 2005
Posts: 16
|
12-04-2009 07:49
When SVC 1853 was being discussed a year ago it was also noted that starting and stopping scripts was laggy so even if it were safe to make unused scripts inactive, apparently the start / stop operation itself is a problem.
It still seems to me that the lowest hanging fruit is to just fix this so scripters can shut off scripts that aren't being used.
A related idea might be to have a third script state for things like sunset/sunrise operations, resizing, setups, etc. that don't have to respond instantly. Rather than constantly revisiting these on each cycle, they could be checked say every forth cycle.
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-04-2009 08:10
If "visiting a script" requires more than performing a single array lookup to see if an event is relevant, that's a bug that needs to be fixed, not worked around.
If it doesn't require more than an array lookup to see if an event is relevant, then the fact that it's visited is irrelevant and no action should be taken.
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-04-2009 08:15
From: SuezanneC Baskerville ...could be
lLinkParticleSystems(list linknumbers, list stridedrules ) Interesting idea but am not sure it'd work.. The problem is that it'd get sticky if the rule set for each link particle system didn't have the same number of things in it. Like, if one needed to do a color change and another didn't, their rules would be different lengths. Tricky for the sim to figure out where one ends and another starts... You could say that each rule set needs to be the same length, I guess. Not sure that there's a performance win on that, though - guess it depends on how costly it is to make multiple calls, one per link, vs being able to do multiple links on one call. I really like the llLinkParticleSystem idea. Is there a JIRA for that yet?
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Ilana Debevec
Registered User
Join date: 25 May 2007
Posts: 130
|
12-04-2009 11:34
From: Meade Paravane I really like the llLinkParticleSystem idea. Is there a JIRA for that yet? Not that I'm aware of.. yet.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-04-2009 14:51
From: Lear Cale A script gets visited EVERY pass, even if it's in a state with no handlers, or just a state_entry handler. THAT's what really needs to be fixed, to reduce the cost of dormant scripts.
Most sims are chock full of dormant scripts. not dormant... idle, dormant scripts are ignored.... but argent is right, their check needs some help (there has to be some kind of a check to see if any conditions have triggered events, and also the script time counter is also always running as long as the script is running, and probably used as the convenient check point.
_____________________
| | . "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... | - 
|
Shadowcat Tiger
Registered User
Join date: 30 Nov 2005
Posts: 16
|
12-04-2009 16:11
From: Argent Stonecutter If "visiting a script" requires more than performing a single array lookup to see if an event is relevant, that's a bug that needs to be fixed, not worked around.
If it doesn't require more than an array lookup to see if an event is relevant, then the fact that it's visited is irrelevant and no action should be taken. I haven't measured it recently, but in the past just having a few thousand active scripts even if they were just waiting on events (timer or touch typically) would severely lag a sim. If that's not true anymore, that is if just having a bunch of active scripts that aren't running isn't an issue, then a lot of this discussion and the plan to limit the number of scripts on a parcel doesn't make sense.
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
12-04-2009 17:52
From: Shadowcat Tiger I haven't measured it recently, but in the past just having a few thousand active scripts even if they were just waiting on events (timer or touch typically) would severely lag a sim. If that's not true anymore, that is if just having a bunch of active scripts that aren't running isn't an issue, then a lot of this discussion and the plan to limit the number of scripts on a parcel doesn't make sense. /me, who owns a club, usually sees 7-8000 active scripts at her home, measured via ctrl-shift-1, at her home. though I've seen it spike up to +12k. There seems to be a line around 9-10k where the sim really starts to thrash. If it's over 10k, that's sorta it - lag central... So, nowdays, "a few thousand" scripts on the sim isn't *that* painful (though I'm sure it makes Babbage cringe) on an otherwise empty region.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!! - Go here: https://jira.secondlife.com/browse/SVC-3895- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-05-2009 06:16
From: Shadowcat Tiger I haven't measured it recently, but in the past just having a few thousand active scripts even if they were just waiting on events (timer or touch typically) would severely lag a sim. If that's not true anymore, that is if just having a bunch of active scripts that aren't running isn't an issue, then a lot of this discussion and the plan to limit the number of scripts on a parcel doesn't make sense. 1. A few thousand LSL scripts hasn't been a major cause of sim lag since they brought in script throttling, at least a year or two ago. A few thousand mono scripts, if they're large, yes... because of the amount of memory they can take up. 2. They're not limiting the number of scripts, they're limiting the amount of memory used by scripts. The issue is memory use, not scheduling or event handling.
|