Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Effect on a sim

Woop Superior
Registered User
Join date: 2 Feb 2007
Posts: 6
03-13-2007 04:05
Just how much effect does a script have on a sim? For instance I have around 10 scripts dotted around our sim, scanning their local area once a minute and reporting the information back via email. The last stage, the email, only happens once a data list is full. So a low use area might only report back once a day, whilst a high use one may well be mailing every couple of minutes.

This is on the Teen Grid, and someone suggested we best check out how much our scripting was contributing to load as the sim was VERY laggy last night. Any tips on how to monitor the overall load being placed on a sim by all the scripts?

Many thanks for any information.
Meni Kaiousei
knowledgebase junkie
Join date: 6 Nov 2006
Posts: 162
03-13-2007 05:15
From: Woop Superior
Just how much effect does a script have on a sim? For instance I have around 10 scripts dotted around our sim, scanning their local area once a minute and reporting the information back via email. The last stage, the email, only happens once a data list is full. So a low use area might only report back once a day, whilst a high use one may well be mailing every couple of minutes.

This is on the Teen Grid, and someone suggested we best check out how much our scripting was contributing to load as the sim was VERY laggy last night. Any tips on how to monitor the overall load being placed on a sim by all the scripts?

Many thanks for any information.


If you open the statistics bar (somewhere in the menu) then you can see all kinds of (also sim) performance statistics (open and close the different sections by clicking on the text).
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
03-13-2007 08:00
If you have property rights to a private sim/island then you can very easily check the 'lag-time' of each script you have.

Go to World-->Region/Estate-->Debug-->Get Top Scripts...

From that window you will be able to scroll through, sort, and search a list of scripts in the sim. Each script will give you a 'time' rating that shows it's general lag. Once you find a script you'd like to monitor...be sure to refresh your search window a few times (especially if it has variable states of activity) to get an accurate reading of the lag-time throughout its entire activity cycle.

Currently, anytime I have a script ready for 'commercial release' through my store, I'll go through these steps and I've found the following:

Any well-made/well-thought-out script should be able to achieve a lag rating if less than 0.01 through most of its existence/activity. I generally try to hold myself to 0.005 or less.

The lowest return number a script will ever give you is 0.001. However, you'd be surprised how many 'complex' scripts you can get to return a rating like that.

The NUMBER OF SCRIPTS actually doesn't matter so much. It is the time rating on each of them. My favorite example is that I have a rental box for sale with a lag-rating of 0.005 seconds. I compare myself to another very, very popular rental box that has a lag-rating of 0.05 seconds. In other words, 10 of their rental boxes cause as much lag to a sim as 100 of my rental boxes.

Things to avoid if you want to stay away from lag:

llSetTimerEvent()

llListen(0, "";) <--Note I added the "0" channel there...most private channel listens don't 'cause too much lag, because they only switch 'on' when something is said on their channel.

llSensor/llSensorRepeat()

llEmail()

There are a few others...but those are basically your main targets to remove when trying to make a script more efficient.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.