Eghad!! Best scripting practices don't mean doodle.
|
|
Zalandria Zaius
Registered User
Join date: 17 Jan 2004
Posts: 277
|
06-08-2006 08:24
I'm a manager of a private SIM and I got curious always complaining about other peoples stuff taking up to many resources so I thought ya know what even though I use listeners that trigger on touch if I have to use one, and use link messages and all the "Best Practices to prevent lag".
I took one of my creations out and it's just scripts that do nothing unless someone clicks on it, but there are quite a few of them. So I set it out and run the Top Scripts command from the estate window.
The thing just sitting there doing absolutely nothing is clocking in at .04ms.. This is not good. I've got another thing flying around me that I made, it have sensors and is physcial etc etc and it's getting a whopping 0.003 bouncing up to around 0.08 I'm guessing when they scan.
I'm not exactly sure how to streamline code anymore than just a script with a linked message in it.
Ugh I want to go turn everything off that I own, this is depressing.
*EDIT* Nevermind.. I did go turn everything off and it only improved SIM performance 0.1, I guess it's not as bad as it seemed.. *EDIT*
|
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
06-08-2006 09:04
Heh, you think that's bad...
You should see my Conway's Game of Life object... 200k IPS and more script time than I'd care to admit.
|
|
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
|
06-08-2006 09:49
From: Zalandria Zaius I'm a manager of a private SIM and I got curious always complaining about other peoples stuff taking up to many resources so I thought ya know what even though I use listeners that trigger on touch if I have to use one, and use link messages and all the "Best Practices to prevent lag".
Part of it can be the avatars themselves; people are prone to taking up a bunch of script time. Another thing is, even an inactive script will take up some small amount of time simply because the script scheduler must check it. Therefore, particle scripts, floating text scripts, etc that run once and stop can be deleted or turned off.
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?” Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
|
|
Zalandria Zaius
Registered User
Join date: 17 Jan 2004
Posts: 277
|
06-08-2006 10:08
From: Aliasi Stonebender Another thing is, even an inactive script will take up some small amount of time simply because the script scheduler must check it. Therefore, particle scripts, floating text scripts, etc that run once and stop can be deleted or turned off.
Yeah that's what I"m running into. Unfortunately it's not scripts I can get rid of and have the object still work. If I could set scripts in other prims to not run I'd do it in a flash and have it set them to run when someone clicked it, but that's not possible =-(.
|
|
Candide LeMay
Registered User
Join date: 30 Dec 2004
Posts: 538
|
06-08-2006 10:17
Yes even idle scripts show up in the sim stats as taking time, on the other hand, sims these days seem to handle lots of scripts (if they are written carefully, so continue to do so) - the sim I'm usually in has about 2500 scripts, but things still run fine. How do I know? Timer events are the first to get delayed when the script scheduler is busy. I have a little test that benchmarks fast timer events and in this sim I can still get 20+ timer events/sec. The maximum in a totally empty sim is 22.5 timer event/sec (and 45 link messages/sec)
_____________________
"If Mel Gibson and other cyberspace writers are right, one day the entire internet will be like Second Life." -- geldonyetich
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
06-08-2006 10:17
From: Zalandria Zaius If I could set scripts in other prims to not run I'd do it in a flash and have it set them to run when someone clicked it, but that's not possible =-(. One-time scripts that stop/delete themselves after they are done with their task, and get injected into prims on the time they're needed with RemoteLoadScriptPin()..? mind you i have no idea if it'd actually help with lag, but possibly something that could work, in theory... maybe. o.O; edit: bleh, nvm. i forgot the 3 sec delay on remoteload :/
|
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
06-08-2006 11:41
More information on this phenomenon here: /54/8f/105133/1.htmlScripting best practices DO still matter. If you're constantly trying to make your code "nice", you'll still be able to fit more scripts into a sim before it begins to dilate. The only thing is, you have less control than you might wish you had, because of this dormant script issue.
|
|
Candide LeMay
Registered User
Join date: 30 Dec 2004
Posts: 538
|
06-08-2006 14:35
I would just add that I've prodded lindens (Karen, the development manager) about it back in december and january over email and the scripters mailing list (which is very much dead). Cory was supposed to look at it but the result so far is what we are all used to - a deafening wall of silence. Save your breath.
_____________________
"If Mel Gibson and other cyberspace writers are right, one day the entire internet will be like Second Life." -- geldonyetich
|