Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Time dilation problem

Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
11-03-2007 12:09
I'm having a very curious problem with a script that calls a number of actions in the timer event. Now, suppose that the timer event is once a second. I can believe that due to lag, 60 executions might take more than a minute, but what is happening is that the script is steadily slowing down. The first 60 events take 1 min 10 secs, the next 1 min 20 secs, the next 1 min 30 secs and so on. Eventually it grinds to a halt.

Has anyone ever seen this sort of behaviour before? Any idea what could cause it?
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-03-2007 12:26
From: Daisy Rimbaud
I'm having a very curious problem with a script that calls a number of actions in the timer event. Now, suppose that the timer event is once a second. I can believe that due to lag, 60 executions might take more than a minute, but what is happening is that the script is steadily slowing down. The first 60 events take 1 min 10 secs, the next 1 min 20 secs, the next 1 min 30 secs and so on. Eventually it grinds to a halt.

Has anyone ever seen this sort of behaviour before? Any idea what could cause it?

Would you be willing to post the code?
_____________________
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
11-03-2007 17:25
Not easy, partly because of complexity (scripts call each other), partly because of commercial sensitivity. I wondered if anyone had heard of such a thing happening before.
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-03-2007 17:28
The only thing I can think of is that either you're changing the timer interval somewhere or the operations your code is doing are such that it ends up taking more time to complete as time goes on, but without understanding what it's doing, it's hard to say.
_____________________
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-03-2007 18:29
yea, if your script is taking 77 seconds to complete a cycle...
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
11-04-2007 03:48
From: Tyken Hightower
The only thing I can think of is that either you're changing the timer interval somewhere or the operations your code is doing are such that it ends up taking more time to complete as time goes on, but without understanding what it's doing, it's hard to say.


Well, it's clearly not the first, as there is just

llSetTimerEvent(1) ;
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
11-04-2007 03:54
From: Tyken Hightower
The only thing I can think of is that either you're changing the timer interval somewhere or the operations your code is doing are such that it ends up taking more time to complete as time goes on, but without understanding what it's doing, it's hard to say.


Well, it's clearly not the first, as there is only

llSetTimerEvent(1) ;

and it can't be the second, as each cycle performs exactly the same sequence of operations - it's not as if it has to do any more on the 1,000th cycle than it did on the first.

I'm suspicious about the fact that the cycle calls a function that assembles a long string (four lines of text) and then uses

llMessageLinked(LINK_SET, status, displaytext, NULL_KEY) ;

to send the resulting string to another script. I wonder if LSL doesn't like large strings in llMessageLinked ...
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-04-2007 07:12
I would be more interested in seeing how your script is assembling that long string. I agree with Osgeld here, 70+ seconds is just waaaaay too much. Outside of http or xml-rpc calls, the only time I have seen times like that are with poorly constructed else if tests.

Anyway to make a short and simple example script that you could post? Working it out like that might even highlight an underlying flaw while you are doing it.
_____________________
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
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-04-2007 10:43
From: Jesse Barnett
Outside of http or xml-rpc calls, the only time I have seen times like that are with poorly constructed else if tests.


also dealing with large list, ive seen those things take a few minuets
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
11-04-2007 16:35
Well, I reorganized the two main scripts.

I did have a timer in script 1 that kept time and did some monitoring. It put together a string that included the time, passed that to script 2 using llMessageLinked, and script 2 displayed it using llSetText.

I redid it so that the script 1 timer only controlled the monitoring, and the string is assembled entirely in script 2 using a script 2 timer. It now works perfectly.

Same tasks - just different division of labour and there is no longer a three-line string being passed between the two scripts once a second.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-04-2007 16:40
Woo Hoo!!!!!!!!
_____________________
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