Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Mono can be slower

Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
02-09-2008 16:04
I don't know how state changes actually work on Mono. I'm hoping LL will release the source for the compiler and the VM (like they have for LSO). Until then it's pure speculation. What I do know is the script calls a state change function, what that function does I don't know.

I have a few ideas why it might be slower but they are dependent upon how the state change is actually perpetrated.
1) They may be creating an instance of the state object.
2) It maybe be performing JIT on the state object.
3) They may be registering the events with event handlers; which would mean they would have to find and clear the old event handlers too.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
02-10-2008 20:49
From: Jesse Barnett
Nope, apology comes from me, thought you were criticizing the method, not the outcome. Guess I am still kind of in shock myself after the initial responses in the thread.


Yeah, they just weren't "getting" it.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-11-2008 05:52
I have not been attempting to *break* MONO in any way, just ensure that the complex set of scripts I am developing will work in both environments. But in the process I have made some interesting observations on speed. I have not used any scientific testing/timing method, just a simple start the clock stop the clock type.
My application is all about list manipulation and I have been seeing time in a low lag sim (private island and I’m the only person in it) of 8 seconds to run my test batch.
MONO performs the same test in a reported 0.04 seconds.
The interesting thing is that if I then recompile to LSL, whilst still in ADITI, execution completes in pretty much the same time. My unscientific conclusion is that the LSL2VM implemented in ADITI is also optimised when handling lists.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
02-11-2008 11:21
From: Jesse Barnett
Now look at the dramatic(expected but still dramatic) difference switching over to global variables instead:

CODE
integer a = 0;

global_one(){
if ((integer) a < 500) {
a++;
global_two();
}
else
llOwnerSay((string) llGetTime());
}

global_two(){
global_one();
}

default {
state_entry() {
global_one();
}
}


Wow. You're lucky you didn't do it too many more times.. that's nastily recursive and would quickly run out of memory. :)

(psst.. global functions, not variables ;) )

From: someone
Don't understand yet why MONO results aren't consistent in this case, but instead, returns decreasing values. Have to mull that one over for awhile.


I imagine it is likely as Strife suggested. JIT, or some other kind of initial dynamic startup which it doesn't have to do every time.
1 2