Does it *really* matter if I recompile to Mono?
|
|
Sera Lok
Lok's Low Prim Furniture
Join date: 5 Sep 2006
Posts: 169
|
10-27-2008 13:37
I own a furniture store and almost everything I sell contains a script. Light scripts, pose scripts, menu driven scripts, water scripts, prim movement scripts, color changing scripts.. etc etc etc... I have been told that for the most part, it's not going to make much of a difference if I update these items to mono or not. Is this true or partially true? Am I wasting my time if I recompile these things to Mono? (I'm particularly wondering about sit/pose scripts) And in respect to my lights, and other scripts which have states, are they better to be left LSL compiled? Thank you for any general advice and for entertaining a layman's mono question. 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
10-27-2008 14:02
I wouldn't break my neck doing it. It might make a small bit of difference performance-wise in some scripts, but for the very basic pose/animation/sound/light type stuff it probably won't matter. When you have a bit of spare time grab something, recompile it, test its behavior, and then replace it in the shop. That's what I'd do. **shrug**
|
|
Imaze Rhiano
Registered User
Join date: 27 Dec 2007
Posts: 39
|
10-27-2008 14:58
One major advantage in Mono is that scripts can share code and scripts are only using so much memory as they need.
For example, if you have classic LSL sitting poseball script. (Simple script - few lines of code and you probably paid way too much from it.) Your living room furniture set is using this sitting poseball script in 10 different chairs in the set. These 10 classic LSL scripts are using 10 x 16Kb = 160Kb memory. Classic LSL scripts are using allways 16Kb memory each.
If you compile them to Mono LSL scripts they are using - let's say 2Kb memory each. This is possible, because Mono only uses memory that it needs to store script's code and data. So your Mono compiled living room furniture set would now use just about 32Kb memory total.
Now it is possible to share code memory between Mono scripts. This happens, if same COMPILED script is used in multiple script instances. To achieve this, you would need to first compile script in one object - then copy this compiled script to your inventory and drop it from there to other objects. If you do this - this simple sitting script would use just something like 1Kb to store it's data and 1Kb that is shared between all scripts. Your furniture memory usage would have been reduced from 32Kb to 17Kb.
17Kb, 32Kb or even 160Kb doesn't sound much - but multiple those by something like 7500 scripts that are running in SIM and you will start seeing differences.
|
|
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
|
10-27-2008 15:19
Sera, I own a furniture shop too and I will recompile all my items to Mono because of what Imaze said, but also because it's just the future of SL. Of course it's a lot of work. But not so much if you use the option in the (I believe) Tools menu. There you can recompile ALL scripts in a linked object in one time. I'm not in-world right now, so I don't know how the option is called. But it's there.
|
|
Sera Lok
Lok's Low Prim Furniture
Join date: 5 Sep 2006
Posts: 169
|
10-27-2008 15:30
From: Imaze Rhiano One major advantage in Mono is that scripts can share code and scripts are only using so much memory as they need. <snip> Now it is possible to share code memory between Mono scripts. This happens, if same COMPILED script is used in multiple script instances. To achieve this, you would need to first compile script in one object - then copy this compiled script to your inventory and drop it from there to other objects. If you do this - this simple sitting script would use just something like 1Kb to store it's data and 1Kb that is shared between all scripts. Your furniture memory usage would have been reduced from 32Kb to 17Kb.
This makes sense - a lot of work, but makes sense.. my followup question is, if i edit the *same* script in inventory (for example, to have different target w/ a pose script or different light properties for a light script), and drag into my prims.. as long as it's the same script in my inventory, will it still behave this way, all operating from the same script memory-wise even if the data has been slightly changed? Even if not, I can see the advantage for multiple variants of identical script sets although I'm just not sure how much of an advantage it is and whether it is worth the cost of time spent doing it, as HeeWee implied. Thanks for the responses so far ^^
|
|
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
|
10-27-2008 17:46
From: Imaze Rhiano Now it is possible to share code memory between Mono scripts. This happens, if same COMPILED script is used in multiple script instances. To achieve this, you would need to first compile script in one object - then copy this compiled script to your inventory and drop it from there to other objects. If you do this - this simple sitting script would use just something like 1Kb to store it's data and 1Kb that is shared between all scripts. Your furniture memory usage would have been reduced from 32Kb to 17Kb. I have a question about this too! Does this also apply if the original script is copied from an object to another object with llRemoteLoadScriptPin()?
_____________________
+/- 0.00004
|
|
Fenix Eldritch
Mostly harmless
Join date: 30 Jan 2005
Posts: 201
|
10-27-2008 18:13
Sera, I don't think that would work. Once you make any changes to the script it will need to be compiled again. And doing that generates a new asset ID. From: http://wiki.secondlife.com/wiki/Mono 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 One possible way around this is to set up your scripts to be able to have their variables updated without needing to edit the script. Like having it read a notecard or listen on the chat channels for updates.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
10-27-2008 18:29
Huh. You know, they should really keep a hash of the compiled bytecode, and when hashes are identical, make a full comparison of the bytecode. If 100% identical, share the compiled module. Then it wouldn't matter if you compile then copy, or copy then compile, or even add a few comments into one version. Hopefully there are a few minds in LL thinking along those lines. Then again, maybe I should polish up my resume. 
|
|
Perry Windlow
Registered User
Join date: 7 Oct 2008
Posts: 17
|
10-28-2008 14:17
I use Mono for everything but before you go wild on Mono check the Jira http://jira.secondlife.com/browse/SVC-2908
|
|
Sera Lok
Lok's Low Prim Furniture
Join date: 5 Sep 2006
Posts: 169
|
10-28-2008 15:25
From: Fenix Eldritch Sera, I don't think that would work. Once you make any changes to the script it will need to be compiled again. And doing that generates a new asset ID.
One possible way around this is to set up your scripts to be able to have their variables updated without needing to edit the script. Like having it read a notecard or listen on the chat channels for updates. Durn.. well a girl can dream. Thanks for clearing that up, I wasn't sure how UUIDs were created w/things that can't be rezzed. (I think I will have to make my modifiable scripts no mod to myself by sending them to an alt and back to myself... so I don't change them unintentionally... that does work, i hope, lol) Nod, I do have a few notecard configged scripts, although I'd say at least half of these are no mod so I don't think I have the option of recompiling them. Guess I'll hafta contact the scripters in that case.
|
|
Sera Lok
Lok's Low Prim Furniture
Join date: 5 Sep 2006
Posts: 169
|
10-30-2008 15:04
How do I know for sure if a no-mod script is actually recompiled to Mono? The viewer allows me to recompile no-mod scripts in an object to Mono, but after that, what is the proof that it really is recompiled? Perhaps I wouldn't be so suspect, but the script window shows a greyed out checkbox at the bottom, whether it's actually Mono or not... Pehaps I'm missing something basic..
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
10-30-2008 15:14
From: Sera Lok The viewer allows me to recompile no-mod scripts in an object to Mono, but after that, what is the proof that it really is recompiled? It does? Hmm. It shouldn't. Maybe it's really a, "compile all scripts in this object that I CAN recompile." Doesn't it pop up a dialog when you do it listing the names of the scripts that have been compiled? That doesn't tell you which prims they are from, but it should be something you can start with.
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
10-30-2008 15:21
From: Paulo Dielli But not so much if you use the option in the (I believe) Tools menu. There you can recompile ALL scripts in a linked object in one time. If you do this you will lose the shared code advantage of Mono. To get that you have to compile the script once, and then replace the scripts in all the other objects with it.
|
|
Sera Lok
Lok's Low Prim Furniture
Join date: 5 Sep 2006
Posts: 169
|
10-30-2008 17:49
From: Hewee Zetkin It does? Hmm. It shouldn't. Maybe it's really a, "compile all scripts in this object that I CAN recompile." Doesn't it pop up a dialog when you do it listing the names of the scripts that have been compiled? That doesn't tell you which prims they are from, but it should be something you can start with. Nod, if i put a single no mod script into a box, and go to Tools, then Recompile Scripts in Selection-> Mono, it says it is recompiling one item, and then Done. But because of that "all no-mod scripts look like they are mono but it's greyed out" thing, i feel doubtful it's actually recompiled.
|
|
Sera Lok
Lok's Low Prim Furniture
Join date: 5 Sep 2006
Posts: 169
|
10-30-2008 23:07
From: Hewee Zetkin It does? Hmm. It shouldn't. Maybe it's really a, "compile all scripts in this object that I CAN recompile." Doesn't it pop up a dialog when you do it listing the names of the scripts that have been compiled? That doesn't tell you which prims they are from, but it should be something you can start with. nm, you are right ^^ when i recompile when there are actual scripts that CAN be recompiled, it tells me 7 items are going to be recompiled and 3 don't make the list. ok then, solves that problem... lol. thx!
|