2 Jul 2006

reloop lag testing

Filed under: Scripting, Primpop Stuff — Stella Trenchmouth @ 7:22 pm

Happy about this one - i was recently given estate manager access to Suffugium, and have pretty much been only playing with the top script usage tools as yet. It’s some pretty neat insight into how nasty some scriptys can get (and should be available to any & all parcel owners on the mainland - miserable old Eldora with it’s 2000+ scripts running constantly, it’d be at least interesting to see why things are so pokey).

So, Reloop being the fearsomely laggy beast that it is, i decided to run some tests. Here’s the average of 10 separate “normal use” runs (via SL 1.10.5(1), and using the big version with speakers containing around 30-40 scripts):

reloop v1.2.6 sim CPU script usage
—————————————–
1) machine rezzed, idle: 0.3-0.4ms
2) cartridge loading (scan/verify): 2-4ms
3) cartridge loading (sample loading): 0.3-0.5ms
4) playback: 0.3-0.4ms
5) playback with active fade in/out: 0.4-1.0ms (~1.0ms with 12 samples fading at once)
6) power off after playback: 0.3-0.4ms

For reference, a completely empty script takes about 0.07ms (i believe, forgot to write that down), most idle vendor scripts run about 0.09ms. I think Suffugium normally goes between 9-15ms of total script time (accounting for the drones & automated cars, holoball, avatars, etc), at any given moment.

What all that means: it’s not half as bad as i thought! The cartridge scanner is a bit laggy, but considering what all it has to do (scan for the cartridge, check all the samples & proper permissions once found, etc), it’s not so bad, and goes away quick once a cartridge is found & loadable.

The biggest script lag comes from fade in/out, which i expected - it’s a logarithmic fade, all looping math, so it’ll suck down all the resources it can when triggered. Even then, it’s pretty tolerable. Fading 12 samples at once in a packed sim would probably be a bad idea, though.

Of course, the real lag comes from the sounds - the sim has to grab the sound files & push them to every avatar standing in range. Not much that can be done about that still.

Anyway. Thought that’d be info worth sharing with other Reloop owners. I’m pretty surprised by the results, and may be smirking a bit.

10 Jun 2006

Sim Monitoring (pt 1)

Filed under: Scripting, General SL Stuff — Stella Trenchmouth @ 11:10 am

(edit: better syntax highlighting. it’s good things.)

I’ve gotten a few questions regarding my sim monitor doodad from folks trying to track their own, so I figure it’s useful enough to show off. First, PHP5 and mySQL are necessary, along with an email address you can push to a PHP script (via .forward or whatever mail pipe your system allows) and access to crontab (you can skip this one, but it’s handy). Also: this hasn’t been tested on Windows type setups at all, I trust them as far as I can crash them.

1) It’ll use email. HTTPRequest is awesome and would be near real-time, but I’m after a statistical history & low overhead. If you want real-time, go stand in the sim with the sim stats open & save your requests for something more useful :p
2) I like having only one email address piped to a script, but have multiple things going on. So we’ll set up a message queue as well, using cron to get all the messages to their proper handlers.
3) We’re only tracking dilation. Easy to get to via LSL, nice & simple. Not too tough to extend to tracking wind speeds, or whatever. Sim Dilation is more useful to me though.

(more…)

15 Apr 2006

llHTTPRequest pt 2

Filed under: Scripting, General SL Stuff — Stella Trenchmouth @ 1:50 am

My new favorite LSL function just popped up on the preview grid yesterday and I’ve been going nuts with it. I’ve already worked out the basics of a nice request handler class for PHP 5 to simplify service creation, a bit similar to how xajax handles itself. And it’s a bit more robust, falling back on email when the web response would be too long. Since 1) UTF-8 can be pretty hard to predict byte-wise, and 2) there’s a 2kb limit on http responses, it’ll try to convert the response to UTF-8 first and gauge whether to send via the response (under 2kb), or chop it up into object emails (a 1000 char limit) and only send a flag & the number of mails being sent over http. Theoretically, it’ll take size limitations completely out of the picture.

Haven’t fully tested it yet, but so far, it’s aces - extend the base class with a new method, pass a “method” parameter via the POST with it’s name, along with any parameters, and then it’s 2 lines of code to shoot it off. Rewriting my Eldora dilation tracker with this already, and have several other test scripts in my preview AVs inventory. Soon as it gets tuned up a bit (and i learn more details of in-world usage restrictions - # of requests per minute, caching, etc.), it’ll be released public. It’s strictly PHP5, but shouldn’t take much to work into PHP4 (might already work, but I don’t use PHP4 anymore to test).

As for the LSL side of things, there’s a lot to tweak. Handling multiple emails from a particularly large response in particular - so far, everything’s come back in order, but I expect it’s very possible to receive the emails out of order, and there’s no checking to make sure everything’s reassembled proper.

This stuff (web connectivity) is what drew me into SL, and it’s already changing everything. I can get to my world (which may or may not be a mysql database) from SL directly now through these little pseudo-services, not just over passive email. Keep a central store of item prices and have my vendors load them on_rez, or periodically update; have a prim check my RSS feeds for new posts; implement my own llName2Key() function; do some heavy string parsing or use real arrays and more than 16kb of memory space… There’s a whole lot in LSL that I just don’t bother with due to it’s limitations and, while will surely have it’s own limitations, it’ll be more controllable than a mess of laggy in-world scripts trying to fake it.

Anyway. Hopefully I’ll have this framework done by the time 1.9.1 hits the main grid. Expect it’ll be freely available here & in-world (maybe L$1 for metrics’ sake) around then.

Totally psyched.

31 Mar 2006

llHTTPRequest

Filed under: Scripting, General SL Stuff — Stella Trenchmouth @ 2:43 am

Says Zero Linden:
key llHTTPRequest(list request, string body);

httpresponse(key id, integer status, list headers, string body) { ... }

Wonderful Treasure(s)

Says me: Things could get pretty awesome.

4 Mar 2006

stalking myself

Filed under: Scripting, General SL Stuff — Stella Trenchmouth @ 11:46 pm

Playing with webstuff while the loopy-whatsit simmers (great way to test: let it lie dormant until i forget what it does, then see how it works. mmm, efficiency), and discovered SL’s map API - the SL version of google maps. So I decided to start stalking myself.

I’ve got a nifty email-interceptor message queue set up for tracking several applications already, so i made an avatar attachment that’ll shoot a message to it with my coordinates every 5 or so minutes. The coordinates eventually end up sorted into a little database, which gets thrown at the SL map API, resulting in a nice look at where I’ve been in the last day -> see it here.

Only took an hour or so to set up, and another couple to get the API to play nice, but it’s already hella useful… I can toss on the attachment when i’m in wander-mode, and not worry about forgetting to create a landmark/pick to the neat build / gallery / whatever i came across, i can figure it out from where i’ve been & how long i spent there. And it’s slowly picking up a list of sim names, which could be pretty handy. And all the little curiousities, like what sims do i tend to visit most (pretty obvious considering i rarely leave Eldora, but still), what areas of SL i have yet to visit, etc etc.

Totally unimportant and entirely done for my own absent-minded sake, but thought it was worth noting. Feel free to chase me around, but keep in mind the live map runs about 5-10 minutes slower than i do :)

Eldora is a pincushion.

-st


music is better