Lower lag

A place to provide all of NCI and NCI leadership with questions, suggestions, comments, or any other kind of feedback.
Wellington Beam
NCI Officer
Posts: 1365
Joined: Sun Aug 30, 2009 6:50 am

Re: Lower lag

Post by Wellington Beam » Sun Feb 27, 2011 3:34 pm

I've not found any conclusive studies on the relative merits of lsl and mono but as far as I'm aware the inworld tools for reporting mono memory usage still report the maximum amount of memory it can use and not what it's actually using. That is unless LL have implemented better script usage tools since last March and I missed the announcement.

A maximum of 64KB is allocated for each script but the average mono script uses 9KB and some would be less. I imagine it's similar to how memory allocation works in Linux. The kernel will keep on assigning memory until all the physical memory is allocated and a reporting system might show the server's run out but in reality it hasn't. If a new process needs memory and existing processes are allocated the total available memory but not using it all then the kernel will free some up for the new process.

https://blogs.secondlife.com/community/ ... ipt-limits
http://wiki.secondlife.com/wiki/Mono

Still be interesting to see some real comparisons though.
baa

LindaB Helendale
Posts: 343
Joined: Tue Oct 20, 2009 4:38 pm

Re: Lower lag

Post by LindaB Helendale » Mon Feb 28, 2011 1:28 pm

I talked with Becky Pippen who knows things, and even though Mono uses dynamic memory allocation, and average mono script is much smaller than LSL, Lindens apparently had some problems moving the variable size virtual machines across sim borders and it's likely all Mono scripts are actually reserved 64 kB in the server (contrary to all the wiki pages).

So to save memory, LSL would be preferred, for small scripts.
To reduce lag, LSL may help if the sim server is swapping (and 5% of servers are according to babbage linden) and if converting the scripts to LSL would end that swapping, but LSL is so much slower it's more likely that LSL adds lag.
ℒindα ℬ

PeaceSmythe
NCI Officer
Posts: 369
Joined: Mon Aug 31, 2009 10:55 pm
Location: Nomad

Re: Lower lag

Post by PeaceSmythe » Tue Mar 01, 2011 8:24 am

I honestly wonder how this is going to interact with personal script limits.

Peace

Janet Rossini
Posts: 4205
Joined: Mon Aug 31, 2009 6:44 pm
Contact:

Re: Lower lag

Post by Janet Rossini » Tue Mar 01, 2011 11:31 am

I don't think I understand the wonder. Reducing region script usage will surely help reduce overall lag for the same level of personal scripts, but that seems so obvious that it must not be what you're wondering about.

Tell us more about this wondering ...
I don't work here: I volunteer here. I don't have duties: I have small gifts which I offer.

Janet Rossini
NCI Supporter
http://valkyriejanet.wordpress.com

Wellington Beam
NCI Officer
Posts: 1365
Joined: Sun Aug 30, 2009 6:50 am

Re: Lower lag

Post by Wellington Beam » Tue Mar 01, 2011 12:29 pm

As I understand it there will be separate limits for avatar, parcels and regions. As far as managing NCI's script usage goes we can only really look at parcel scripts.
http://wiki.secondlife.com/wiki/User:Be ... Limits_FAQ

If we need somewhere to test and compare scripts then DS would be best since we have estate powers and testing can be done without affecting other land owners. When I've looked at the top scripts I paid more attention to script time than memory usage but you can't do that on mainland yet.
baa

Janet Rossini
Posts: 4205
Joined: Mon Aug 31, 2009 6:44 pm
Contact:

Re: Lower lag

Post by Janet Rossini » Tue Mar 01, 2011 1:00 pm

are estate powers in DS available to us all, or must we do something or be blessed in order to use them?

thanks,
I don't work here: I volunteer here. I don't have duties: I have small gifts which I offer.

Janet Rossini
NCI Supporter
http://valkyriejanet.wordpress.com

PeaceSmythe
NCI Officer
Posts: 369
Joined: Mon Aug 31, 2009 10:55 pm
Location: Nomad

Re: Lower lag

Post by PeaceSmythe » Tue Mar 01, 2011 2:38 pm

What I was referring to was the memory useage of Mono vs LSL compiled scripts. Will all mono scripts start at 64k? If things are so uncertian, how do we achieve a reasonable assesment of memory useage? I'm asking this more rhetorically atm.

Peace
--Peace

fr43k Paine
Posts: 34
Joined: Tue Sep 01, 2009 8:52 pm
Location: Germany

Re: Lower lag

Post by fr43k Paine » Wed Mar 02, 2011 6:09 pm

Beverly Montgomery wrote:...and fr43k didn't you know that some scripts still work even after being removed. hehehe just a reminder there. :D
I did know that, Bev. One question was, if we could use that to our advantage.
LindaB Helendale wrote:...it's likely all Mono scripts are actually reserved 64 kB in the server (contrary to all the wiki pages).
Yes, I heared a dozens of misc. scripters saying the same. That's why I suggested to have someone in the team, who knows a lot about the server software that LL is using, as IDK how the (different) server software handles the memory stuff. If it works like under Linux, as Welli mentioned, there might be no reason to do all that work.
LindaB Helendale wrote:... but LSL is so much slower it's more likely that LSL adds lag.
Does that mean, that LSL uses less memory but causes a higher CPU-load?

Imnotgoing Sideways
Posts: 854
Joined: Sun Aug 30, 2009 9:14 pm
Location: Morbidette, SL
Contact:

Re: Lower lag

Post by Imnotgoing Sideways » Wed Mar 02, 2011 10:18 pm

This is where I've gotten my information on Mono. (^_^)
http://wiki.secondlife.com/wiki/Mono
Has the available memory for scripts changed? (Currently 16k in LSL2 VM)
For the same LSL script the Mono bytecode and original (LSL2) bytecode will be of different size. In order to be compatible with all known scripts, we have expanded the size ceiling for Mono to be 64k. This is ok to do for Mono because unlike LSL2, Mono allocates memory dynamically, whereas all LSL2 scripts occupy 16K. Mono scripts only allocate the memory that they need.

64K? Wow, isn't that going to encourage inefficient scripting?
We hope that the change will promote more efficient scripting. Currently programmers have to get around the 16K limit by using multiple scripts, and a lot of cycles get spent on passing data between those scripts. With a single script that would not be necessary.

Are there other ways to make my scripts even more memory efficient when using Mono? ;
Indeed, Mono can do what's called bytecode sharing. Suppose you have a region which uses many instances of the same script, like XYText or Puppeteer, for example. As long as all the instances share the same asset id, the bytecode will only be added to memory once, and shared by all the copies. Key to making this work is ensuring that you simply copy the scripts (or the objects the scripts are within) after they have been saved for the final time. If you have purchased a script that is used many times, ask the creator for a Mono version, and then copy that version into the objects. It's important that you copy the scripts, so that the asset id is the same. If you recompile each instance separately, they will get different asset ids and the engine won't be able to share the bytecode.
Though, I've heard that the "Mono rezzing" lag symptom is the result of full memory allocation in one shot and that the wiki is possibly outdated and even incorrect in the first place. But, such is rumor and wiki. Can't tell what's what until we try it out. (^_^)y
What would life be like in a world without nipples? =^-^=

Janet Rossini
Posts: 4205
Joined: Mon Aug 31, 2009 6:44 pm
Contact:

Re: Lower lag

Post by Janet Rossini » Wed Mar 02, 2011 11:17 pm

i wonder just what they mean by "copy the script". Drag from inventory? Or ... ?
I don't work here: I volunteer here. I don't have duties: I have small gifts which I offer.

Janet Rossini
NCI Supporter
http://valkyriejanet.wordpress.com

Post Reply