Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Multiple Listens vs. Unfiltered Listen

Siann Beck
Beauty & Braiiiiinsss!
Join date: 14 Jul 2007
Posts: 140
12-03-2007 13:03
I have an object that needs to listen to a number of other objects. The number of objects will vary, but it will have their keys. Would it be more efficient to have a separate listen for each object, filtered on its key, or a single listen for all objects, with key checking done in the listen() handler?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-03-2007 13:16
From: Siann Beck
I have an object that needs to listen to a number of other objects. The number of objects will vary, but it will have their keys. Would it be more efficient to have a separate listen for each object, filtered on its key, or a single listen for all objects, with key checking done in the listen() handler?

IIRC if you create individual listens on the same channel, the sever parses them as a list, so that would be more effecient, and should be faster than parsing them in your script
_____________________
|
| . "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...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-04-2007 12:34
Well, are we talking script efficiency or running efficiency on the sim? Wouldn't a single listen produce less lag on the sim? I may be wrong, but I think that's the spirit of the OP's question... although I may be wrong. Personally, I try to keep to one listen, which I turn off when not in use, to lighten the load on the sim.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-04-2007 19:26
From: Johan Laurasia
Well, are we talking script efficiency or running efficiency on the sim? Wouldn't a single listen produce less lag on the sim? I may be wrong, but I think that's the spirit of the OP's question... although I may be wrong. Personally, I try to keep to one listen, which I turn off when not in use, to lighten the load on the sim.

I'm pretty sure the server combines the individual listens into a list, and runs much more effeciently than the scripted version ... and since scripts are just extensions to the server code, filtering it at the higher level is likely to be more effcient, assuming it's implemtnted that way... it could easily be tested in an empty sim... just rezz a ton of them and then spam the channel from multiple sources
_____________________
|
| . "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...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-06-2007 14:50
Hmm, might be worth a try just to see. What you're saying seems to make sense. I just so happen to have a sim to myself too (mostly) :)