Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Whitch would be less Laggy?

Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
12-22-2008 04:05
I want 10 objects in a region to report information to an object in the region every 1 second.

Now would it be less laggy to do via llRegionSay, or by doing a http request? as in sending it to php -> mysql and then having the object that need the information get it back via php.

Thanks.
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
12-22-2008 04:17
For what it's worth.......I wouldn't use httprequest just because of the volume of requests that would get sent to my server. My server is a personal server and sits at the end of my desk and rides on my home's internet access. Most folks don't have that and rent access on somebody else's server. In most cases like that, your flow of traffic is metered. Too much traffic and you pay extra. Httprequests at 1 second intervals "could" generate a lot of traffic, traffic that a percentage of the time won't get through because of internet traffic in general. llRegionSay may cause some lag for that particular sim. There are too many variables to really give you a good answer.
_____________________
There are no stupid questions, just stupid people.
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
12-22-2008 04:41
What is it that would require such an incredibly high speed?

Even a 3D avatar tracker would only need to poll every avatar at 2 seconds at least with llGetObjectDetails into one single object.

So we can't really give you any suggestions.
_____________________

Geometric Library, for all your 3D maths needs.
https://wiki.secondlife.com/wiki/Geometric

Creator of the Vertical Life Client
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
12-22-2008 05:19
The server does not matter.

I just want to know which would be less laggy, nothing else.
Buckaroo Mu
Alpha Geek
Join date: 17 Oct 2006
Posts: 106
12-22-2008 07:18
Best bet would be to have the 10 objects communicate with a gateway device via RegionSay, have that gateway device communicate with the webserver - with data for all 10 objects in the same call, rather than 10 separate calls.

However, that's going to be some incredibly iffy coding either way. You're hoping here that the webserver will get the request, process it, and return a result in 1 second? Or worse, 10 in one second? Not that a webserver couldn't do it, but I dunno about LSL.

Remember also that using llHTTPRequest, each object can only make up to 25 requests per 20 seconds. That's each object, not prim, not script.

Any way you slice it, this is going to be laggy. I'd really consider going with a longer delay than one second.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-22-2008 07:54
My experience has been that llHTTPRequest() actually uses a LOT of script time. Even one script every few seconds seems to place the containing object way up on the Top Scripts list for some reason. So I'd make as few HTTP requests as possible. Go with the llRegionSay().
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
12-22-2008 11:29
I don't know for sure, but I think this is less laggy.

Let the 10 objects place their reports in their description (llSetObjectDesc) and retrieve this info with llGetObjectDetails. You could the 10 objects send their keys (once on rez?) with llRegionSay.
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
12-23-2008 11:09
Yeah, Leonardo has hit the nail on the head.

llGetObjectDetails was (afaik) specifically written to provide direct access to object information without creating ridicolous workarounds of elaborate sensor setups or sophisticated listener communication protocols.

Oh and less timers/listeners/sensors/scripts is a big bonus to efficiency. It is always a lot faster and easier if there is no hopping of data needed between seperate scripts, especially if they are totally seperate objects.
_____________________

Geometric Library, for all your 3D maths needs.
https://wiki.secondlife.com/wiki/Geometric

Creator of the Vertical Life Client
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-23-2008 12:13
llRegionSay is far cheaper, but far less secure.
_____________________
http://slurl.com/secondlife/Together
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
12-23-2008 12:19
From: Escort DeFarge
llRegionSay is far cheaper, but far less secure.

no.
use an encrypted channel and encrypt the message.
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
12-23-2008 12:55
llRegionSay is far cheaper Escort???? Ten objects that every second send a message??? I Cannot imagine that it is FAR cheaper than retrieving info with llGetObjectDetails.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-23-2008 13:51
From: Lennard Lopez
llRegionSay is far cheaper Escort???? Ten objects that every second send a message??? I Cannot imagine that it is FAR cheaper than retrieving info with llGetObjectDetails.

I answered the OP -- i.e. which is more laggy -- http or region say. You are asking a different question... so...

Blow by blow i'd expect llRegionSay to be about the same as llGetObjectDetails, but i never directly compared them (wrt to sim cpu load).

/esc
_____________________
http://slurl.com/secondlife/Together
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-23-2008 14:38
Also depends on just exactly what the data is, because anyone can read object description.
_____________________
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
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
12-23-2008 14:59
Which could still be encrypted and be less laggy nonetheless...
_____________________

Geometric Library, for all your 3D maths needs.
https://wiki.secondlife.com/wiki/Geometric

Creator of the Vertical Life Client
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-23-2008 16:00
From: Nexii Malthus
Which could still be encrypted and be less laggy nonetheless...

Well no, not at all, think about this for a minute. Show me one encryption setup that is worth it's salt and that isn't going to a very, very hard on the sim. 10 objects encrypting their messages and the receiver decoding those very same messages every second??????

And as far as this goes. Why is anyone thinking that llRegionSay is so unsecure? Name the sim and I'll put a prim in it that is repeating a message and I will challenge anyone to tell me what that message is. Four billion+ channels is one heck of a lot of channels to scan.
_____________________
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
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-23-2008 19:04
From: Jesse Barnett
Name the sim and I'll put a prim in it that is repeating a message and I will challenge anyone to tell me what that message is.

Now that would be a really interesting test :) I'll provide the sim lol.
_____________________
http://slurl.com/secondlife/Together
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
12-24-2008 11:03
From: Escort DeFarge
I answered the OP -- i.e. which is more laggy -- http or region say. You are asking a different question... so...

Blow by blow i'd expect llRegionSay to be about the same as llGetObjectDetails, but i never directly compared them (wrt to sim cpu load).

/esc

Bad guess, based on what we've been told about how chat works. Every chat message takes time per scripted object with an active listen. Not necessarily in the script -- if it doesn't match the listen() arguments it won't activate the script, but it does take some processing, for that object, on the server. (Note that I've heard conflicting stories about how listens work, and so far, none that actually sound quite plausible, but regardless, the above holds and is likely to be true except for one possible optimized implementation that I seriously doubt they're doing, and might not even pan out.)

However, relaying http isn't insignificant either. I'd have a hard time deciding which was worse. Using either RegionSay or HTTP would probably be a hit on the server and would be unneighborly to run all the time unless you own the whole region. (If it was just when some game is being played, then never mind.)

Using llGetObjectDetails would reduce it to barely significant. The server hashes directly to the correct object and gets the description, which it needs on hand anyway.

Otherwise, I'd seriously question the need to update once per second for all instances. It wouldn't be a good architecture. But with llGetObjectDetails I wouldn't worry, unless you do need security.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
12-24-2008 11:04
From: Jesse Barnett
Well no, not at all, think about this for a minute. Show me one encryption setup that is worth it's salt and that isn't going to a very, very hard on the sim. 10 objects encrypting their messages and the receiver decoding those very same messages every second??????

And as far as this goes. Why is anyone thinking that llRegionSay is so unsecure? Name the sim and I'll put a prim in it that is repeating a message and I will challenge anyone to tell me what that message is. Four billion+ channels is one heck of a lot of channels to scan.


I agree. The odds of anyone finding which of the 4 billion channels you're using are vanishingly small. Intercepting the messages requires knowing the channel or hacking the server, since they're not sent outworld unless they're on channel 0.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-24-2008 12:23
From: Lear Cale
Bad guess, based on what we've been told about how chat works. Every chat message takes time per scripted object with an active listen.

Dude. If they don't have a queue of listens per channel (hashed or efficiently sorted with a tree by channel number) then they should be shot. There's a reason you can't listen to, say, a RANGE of channels. You have to pick ONE. That first filtering step should be very efficient, and make the processing scalable enough not to take time for every listen in the sim. I think if it weren't we'd have nothing close to the performance we DO have, what with all the script chatting that IS out there. People are WAY too paranoid about chats delivered to non-public channels. This kind of thing is what non-zero channels are there for.

If llGetObjectDetails() can work for the application, then fine: use it. But keep in mind that solution is going to introduce issues with synchronicity (WHEN do you check object details? how do you know new data is available?). If that complicates the logic, just go with the chat, which is designed for delivery of just such messages.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
12-24-2008 14:38
How much data are you talking about per object per poll cycle, Nyx? Also, do you need to have that data reported every second or just collected every second?
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
12-24-2008 15:15
Spelling which correctly so my browser doesn't have to load the T. :rolleyes:
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-24-2008 17:00
From: Lear Cale
Bad guess, .

I beg to differ - -it's not entirely a guess. Hewee basically said it, but frankly I'd have to measure the two properly to be convinced. I expect there to be very little difference - remember we are talking about *region* say which is the most efficient form of "say".

/esc
_____________________
http://slurl.com/secondlife/Together