These forums are CLOSED. Please visit the new forums HERE
Does an open listen still generate lag if it never hears anything? |
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
11-27-2006 07:58
Ok, I can understand minimising the number of occasions on which a listen event handler starts up and then halts because the message it heard wasn't what it was looking for. But does just having a listen open on a channel that's never used (assuming such a thing exists) cause lag? And if so, how much?
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
11-27-2006 08:17
Active listens each cause a small amount of lag, even when they are listening on a dead channel, due to the way the sim software is designed. Pretty much, whenever a chat message is sent on any channel, the sim scans a list of all active listens in a sim, and checks each for a matching channel, name, key, message, and position (in range of "hearing" it). When it has a match, it generates an event for the script that matched, and continues checking.
The problem is not really with one listen, but with having hundreds to thousands of scripts with one listen. Chat becomes laggy as the length of the "listen list" grows to huge sizes. Thus, in many sims which have lots of potential sources for listens, like malls full of vendors, they usually demand that you turn off any listens on your vendors to reduce said lag. |
|
Feynt Mistral
Registered User
Join date: 24 Sep 2005
Posts: 551
|
11-27-2006 08:38
It's a commonly held belief that using a channel that isn't frequented will reduce the impact of your script on the sim. I can see this being true on the basis that the more scripts listening on a channel, the more scripts the sim has to feed the message to. Listeners on channel 0 for instance would be fed everything that everyone says. A listener on channel 1000000 however might receive one message a day, or perhaps it does get triggered often (like a memo taker or a tail position adjuster), but the point is it's likely to be the only listener on that channel.
Having any listener active though will likely still have an impact on the sim, as the sim probably needs to compare the incoming message against its list of open channels before feeding the message to all listeners on that channel. This wouldn't be the case if every channel gets an entry in a gigantic array and the message just gets fed to a particular entry in that array for chat, but that's probably super memory inefficient. _____________________
I dream of a better tomorrow in SL!
You should too. Visit, vote, voice opinions. Support CSG! Tell LL how much it would mean to subtract one prim from another! Prim Animation! Stop by and say something about it, show your support! |
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-27-2006 15:34
If you go test it out, which I have done briefly and some time ago:
Any llListen has a small impact on the sim's performance, but there's no surprise there I hope. It's not a huge impact in and of itself. Triggering the listen event suddenly makes more code run, and so a heavier impact, again as you may expect. Thus, open listens on channel 0 get hit a lot and slow things down frequently. Listens on channel 1,000,001 get hit less often, so although when they run they slow the sim down just as much, they're triggered less often so their overall impact is lower. The tools don't let you detect a difference in the various other filters and their impact on the sim that I saw. i.e. I couldn't see a difference between llListen(1001, "", "", "" ; and llListen(1001, "", llGetOwner(), "" ; and llListen(1001, "Eloise Pasteur", llGetOwner(), "test" ; although again I'm guessing the overall impact is lower just because it's even less likely to fire. I am also guessing that the impact is *briefly* higher as whatever order it processes filtering in (channel first seems likely) it then does some extra tests if necessary before triggering the listen event, just the granularity isn't fine enough for the small extra load._____________________
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
11-27-2006 16:04
An interesting thing to note is that listens will have an impact on your script itself. If you have something with 64 listens open (please don't do this
), even in amazing sim performance, the listens will report relatively slowly. |
|
Feynt Mistral
Registered User
Join date: 24 Sep 2005
Posts: 551
|
11-27-2006 18:38
That is interesting actually. Luckily I'm not nuts enough to use more than two listeners per script.
_____________________
I dream of a better tomorrow in SL!
You should too. Visit, vote, voice opinions. Support CSG! Tell LL how much it would mean to subtract one prim from another! Prim Animation! Stop by and say something about it, show your support! |
|
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
|
11-28-2006 13:58
Does a falling tree lag a sim when nobody is around to feel it?
|
|
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
|
11-28-2006 14:31
Does a falling tree lag a sim when nobody is around to feel it? This may have been a joke but it is reality in SL. In some sims with no one in them that is considerable lag. |
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-28-2006 15:09
Does a falling tree lag a sim when nobody is around to feel it? No but it IM's half a dozen times to let you know when you log back in |
|
Burke Prefect
Cafe Owner, Superhero
Join date: 29 Oct 2004
Posts: 2,785
|
11-29-2006 07:24
Does a falling tree lag a sim when nobody is around to feel it? Yes. and several trees falling on eachother will crash the sim. ![]() |