Difference between revisions of "User:Toy Wylie/Misc/Script Memory"

From Second Life Wiki
Jump to navigation Jump to search
(Started the page, just a small example up yet)
 
(myth/fact)
Line 1: Line 1:
This is an example on why Script Memory Reporters are a bad thing and can't provide the information a land owner is looking for. Banning or kicking people because of the reported script memory size is not helping the case. What we really need is an accurate reporting tool that does not rely on scripts playing nice but reports the true facts regardless of how the script was made.
This is an example on why Script Memory Reporters are a bad thing and can't provide the information a land owner is looking for. Banning or kicking people because of the reported script memory size is not helping the case. What we really need is an accurate reporting tool that does not rely on scripts playing nice but reports the true facts regardless of how the script was made.
===Some Myths and Facts===
'''Myth:''' Mono scripts are much larger! They show as 64k on my reporter, while LSO scripts only need 16k
'''Fact:''' This is inaccurate. It is true that a Mono script needs more memory for the same source code size. However, an LSO script always allocates and uses the full 16k it gets, while a Mono script only uses what it needs, in 4k blocks. And since a lot of scripts are usually very small helper scripts, the memory consumption of Mono scripts is actually lower than LSO:


<lsl>// This standard door script takes up 4412 bytes in Mono
<lsl>// This standard door script takes up 4412 bytes in Mono

Revision as of 07:42, 8 December 2011

This is an example on why Script Memory Reporters are a bad thing and can't provide the information a land owner is looking for. Banning or kicking people because of the reported script memory size is not helping the case. What we really need is an accurate reporting tool that does not rely on scripts playing nice but reports the true facts regardless of how the script was made.

Some Myths and Facts

Myth: Mono scripts are much larger! They show as 64k on my reporter, while LSO scripts only need 16k

Fact: This is inaccurate. It is true that a Mono script needs more memory for the same source code size. However, an LSO script always allocates and uses the full 16k it gets, while a Mono script only uses what it needs, in 4k blocks. And since a lot of scripts are usually very small helper scripts, the memory consumption of Mono scripts is actually lower than LSO:

<lsl>// This standard door script takes up 4412 bytes in Mono // and 16384 bytes in LSO. An outside script reporting tool // would report it as 65536 bytes in Mono and 16384 in LSO.

rotation home; integer isOpen=FALSE;

open() {

   if(isOpen)
       llSetLocalRot(home);
   else
   {
       home=llGetLocalRot();
       llSetLocalRot(home*llEuler2Rot(<0.0,0.0,90.0>*DEG_TO_RAD));
   }
   isOpen=!isOpen;

}

default {

   touch_start(integer total_number)
   {
       llOwnerSay((string) llGetUsedMemory());
       open();
   }

} </lsl>