LSL vs Mono in small scripts

View: New views
4 Messages — Rating Filter:   Alert me  

LSL vs Mono in small scripts

by Jim Gustafson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

for some of my projects, I need to put small scripts into child prims (for example to animate the prims). I try to make all animations as low lag as possible, so I'm using this only for low frequency animations. Now I wonder if it would be better to compile these small scripts in LSL rather than Mono because I've heard of this memory leak problem in Mono.

What's your advice? Better compile them in Mono or LSL? The Objects are usually in-world objects (birds) not attachments.

Jim


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Re: LSL vs Mono in small scripts

by Domchi Underwood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Oct 18, 2009 at 9:23 AM, Jim Gustafson <jim.gustafson.sl@googlemail.com> wrote:
for some of my projects, I need to put small scripts into child prims (for example to animate the prims). I try to make all animations as low lag as possible, so I'm using this only for low frequency animations. Now I wonder if it would be better to compile these small scripts in LSL rather than Mono because I've heard of this memory leak problem in Mono.

What's your advice? Better compile them in Mono or LSL? The Objects are usually in-world objects (birds) not attachments.

I say, use Mono.

Memory leak in Mono (more details here: http://flyingfrogblog.blogspot.com/2009/01/mono-22-still-leaks-memory.html) happens in specific circumstances, and as far as I know it's hasn't been confirmed that it affects SL server.

Even if it does affect SL server, there is no indication that using LSL instead of Mono script is viable workaround, since LSL scripts run in Mono VM as well. IMO scripts are too far up in the stack to be able to do anything about it; both we and Lindens pretty much depend on Mono folks for fixing that one.

There are a few memory-leak related issues in PJIRA, but none of them has been confirmed. If your scripts run out of memory and you have a way to reproduce it, file a JIRA issue and let Lindens handle it; that's better than relying on unproven workarounds.

In worst case, all you'd be doing by using LSL scripts is probably using more memory by default, placing more burden on the server and making it more likely for bug to manifest and crash the sim because it runs out of memory. :) 


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

RE: LSL vs Mono in small scripts

by Brian Preble :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Actually, there is a huge indicator. Mono scripts run faster, but are rendered nearly unusable in vehicles and avatar attachments, due to the horrible way they’re handed off on border crossings and even when first rezzed.  To confirm, make a simple, default script compiled as Mono.  Load up a prim with 50 or so of the mono versions, and another prim with the same number of LSL scripts.  Then try to rez both.  The mono version will take 10x longer to appear.  Do this on a vehicle and you crash every time you hit a sim border.

 

 

From: secondlifescripters-bounces@... [mailto:secondlifescripters-bounces@...] On Behalf Of Domchi Underwood
Sent: Sunday, October 18, 2009 8:44 AM
To: secondlifescripters@...
Subject: Re: LSL vs Mono in small scripts

 

On Sun, Oct 18, 2009 at 9:23 AM, Jim Gustafson <jim.gustafson.sl@googlemail.com> wrote:

for some of my projects, I need to put small scripts into child prims (for example to animate the prims). I try to make all animations as low lag as possible, so I'm using this only for low frequency animations. Now I wonder if it would be better to compile these small scripts in LSL rather than Mono because I've heard of this memory leak problem in Mono.

 

What's your advice? Better compile them in Mono or LSL? The Objects are usually in-world objects (birds) not attachments.

 

I say, use Mono.

 

Memory leak in Mono (more details here: http://flyingfrogblog.blogspot.com/2009/01/mono-22-still-leaks-memory.html) happens in specific circumstances, and as far as I know it's hasn't been confirmed that it affects SL server.

 

Even if it does affect SL server, there is no indication that using LSL instead of Mono script is viable workaround, since LSL scripts run in Mono VM as well. IMO scripts are too far up in the stack to be able to do anything about it; both we and Lindens pretty much depend on Mono folks for fixing that one.

 

There are a few memory-leak related issues in PJIRA, but none of them has been confirmed. If your scripts run out of memory and you have a way to reproduce it, file a JIRA issue and let Lindens handle it; that's better than relying on unproven workarounds.

 

In worst case, all you'd be doing by using LSL scripts is probably using more memory by default, placing more burden on the server and making it more likely for bug to manifest and crash the sim because it runs out of memory. :) 

 


_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters

Parent Message unknown Re: LSL vs Mono in small scripts

by intel81 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/18, Jim Gustafson <jim.gustafson.sl@...>:

> Hi,
> for some of my projects, I need to put small scripts into child prims (for
> example to animate the prims). I try to make all animations as low lag as
> possible, so I'm using this only for low frequency animations. Now I wonder
> if it would be better to compile these small scripts in LSL rather than Mono
> because I've heard of this memory leak problem in Mono.
>
> What's your advice? Better compile them in Mono or LSL? The Objects are
> usually in-world objects (birds) not attachments.
>
> Jim
>

Some people prefer Mono, others still prefer LSL.
However the truth is that, alas, we are programming for a closed
platform, and not being able to access the bytecode produced by the
compiler is a major obstacle to optimizing scripts, even the small
(non-trivial) ones.
Anyway, this is what LL's knowledge base says:
"Does Mono help reduce lag, or does it create more?
Mono executes much faster than LSL, especially for math-intensive
scripts. This can translate into more simulator cycles available for
other scripts or physics simulation, and that means less server-side
lag. Also, Mono's dynamic memory management only allocates the amount
of memory needed for the script (LSL used to allocate the maximum
allotment of memory even for the smallest script). This benefit is
largely offset, however, by the fact that Mono scripts tend to be
larger than the corresponding LSL bytecode. Ultimately, any benefits
from Mono in speed or memory will only be realized as the scripts in a
Region are converted to run Mono. Initially, and perhaps for a while
after Mono launches, most scripts in a Region will still be running
old-style LSL bytecode, so it's likely no major differences will be
seen at first."

Good luck.
_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters