|
|
|
Hmm... so both of you are seeing results indicating that state transitions for both LSL AND Mono scripts are running slowly in sims with Mono. It could be that there's a bug in the Mono sims making this slower... but couldn't it also be that those Mono sims are just on slower hardware?
Second Life 1.20.15 (92456) Jul 18 2008 10:58:42 (Second Life Release)
You are at 251719.4, 246593.2, 406.5 in Neptune located at sim4540.agni.lindenlab.com (63.210.158.190:12035) Second Life Server 1.23.4.93100 This is the output of Haravikk's script on the main grid: [12:15] Object: 0.000223 seconds/state-change Indeed, there's a factor 100 between the servers. ======= The single-state-change script gives this output on the main grid: [12:25] Object: 0.000000 seconds/single-state-change Ummm ... ======= Here's a different way of measuring: float seconds; seconds = llGetWallclock(); } else state state1; [12:47] agni: 0.001269 LSL: Mono: A factor of 33 Since an LL issue ID has been assigned to this can we please get a comment regarding the problem?
As I understand it, the engine running legacy LSL scripts has actually changed slightly, to dynamically adjust memory, and possibly a few other things, meaning it is more in-line with the Mono engine's behaviour despite still being an interpreted engine. I'm assuming one of these changes must be the cause of the far slower state changes. This has me concerned though, as I've been using states heavily to write a parser, as they're not only much easier to develop, but were more efficient as it means I don't need a huge if statement tree just to keep track of state as I look at each character of the input. Slower state-changes will significantly reduce the performance of my script in-spite of the other Mono speed improvements. I think what's happening here is that state changes are being clamped to 1 per frame.
It looks like you're right, Babbage
Try this modification to Haravikk's script: llOwnerSay((string)(time * llGetRegionFPS()) + " seconds/state-change*sim_FPS"); The output looks like this (while the sim's FPS is varying from 20 to 45): [13:24] Object: 1.082572 seconds/state-change*sim_FPS All values are fairly close to 1. Hmm, is this likely to be changed Babbage? With Mono's speed increases it's possible for my parser to do quite a bit of work in a single frame, meaning that it could change state 3 or 4 times a frame, possibly more, especially with input strings that contain several short input types. I appreciate that you probably don't want scripts constantly changing state all the time, but a limit of 1 per frame may be too harsh.
I would argue that any constraint on state changes is antithetical to the spirit of LSL as a language.
If state changes are clamped, then scripters will resort to heavier use of globals, which will result in more buggy code and as a result fewer rich LSL applications. The VM should support the best use of language (as does the LSL2 VM) not limit its use and expressiveness owing to the limitations of the underlying platform. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You are at 255740.8, 255335.9, 21.0 in Sandbox Goguen MONO located at sim3017.aditi.lindenlab.com (216.82.2.23:13002)
Second Life Beta Server 1.24.4.93464
=======
Look at the comparison between LSL and Mono:
[9:01]
SVC-2746LSL: 0.022235 seconds/state-change[9:01]
SVC-2746Mono: 0.022235 seconds/state-change[9:01]
SVC-2746LSL: 0.022238 seconds/state-change[9:01]
SVC-2746Mono: 0.022233 seconds/state-change[9:01]
SVC-2746LSL: 0.022860 seconds/state-change[9:01]
SVC-2746Mono: 0.022233 seconds/state-change[9:01]
SVC-2746LSL: 0.022240 seconds/state-change[9:01]
SVC-2746Mono: 0.022236 seconds/state-change[9:01]
SVC-2746LSL: 0.022234 seconds/state-change[9:02]
SVC-2746Mono: 0.022238 seconds/state-change[9:02]
SVC-2746LSL: 0.022237 seconds/state-change[9:02]
SVC-2746Mono: 0.022237 seconds/state-changeThe results are identical and very constant.
========
There seems to be a built-in delay, look at the results from this script:
default
{ llResetTime(); state state1; }{
state_entry()
}
{ llOwnerSay((string)llGetTime() + " seconds/single-state-change"); }state state1
{
state_entry()
}
[9:37]
SVC-2746Mono: 0.021857 seconds/single-state-change[9:37]
SVC-2746Mono: 0.022306 seconds/single-state-change[9:37]
SVC-2746Mono: 0.021260 seconds/single-state-change[9:37]
SVC-2746Mono: 0.021777 seconds/single-state-change[9:37]
SVC-2746Mono: 0.021554 seconds/single-state-change[9:37]
SVC-2746Mono: 0.021870 seconds/single-state-change[9:37]
SVC-2746Mono: 0.021511 seconds/single-state-change[9:37]
SVC-2746Mono: 0.021274 seconds/single-state-changeAgain we see very constant results.