Another Performance Comparison Test
Today I performed another performance comparison test between InWorldz and Second Life, this time using something that has been one of the most commonly-alleged sources of lag: chat listeners.
This dates back to the old days in SL, where you are always advised not to run listeners on local chat, for fear of causing lag. Linden Lab claimed things improved in SL, but by how much?
To start off, I used a simple script in InWorldz, it listens on local chat, and then performs a SHA-256 computation on whatever it hears, via the IWSL function iwSHA256String.
I started off with 256 listeners, and had a click-activated object which would shout a random UUID on local chat. Clicking this rapidly showed no observable lag. So, I made copies of the listener prims, until I had 1024 of them. Then I tested again. And again, the scripts caused no lag.
So, I bumped it up to 2048 listeners, and 4096 listeners. Again, the results were the same: the scripts caused no lag. There was SOME lag generated, but it was the usual lag you would get from your internet connection getting saturated with the data of a thousand prims being rezzed.
So, I ran this test again, this time in Second Life. There, the conditions were stacked against SL. The region I tested on had relatively low lag, at about 0.95-0.99 average time dilation. Because iwSHA256String was not available, I used its LSL cousin, llSHA1String. That function computes a SHA-128 hash, which has lower computational performance than a SHA-256 hash.
And, the results: no lag from the scripts, at all. The region continued on as though nothing happened.
Conventional wisdom is that listener scripts cause lag, but by my own testing, it appears that listeners, by themselves, do not cause any lag at all.
That’s not to say that a listener device can’t cause lag. If the listener is running poorly-written code, or is running code that puts load onto the network or server, then it’ll put load onto the simulator. But listeners by themselves do not cause any lag.
The Great Cabbage Catastrophe (Reposted)
Many of my friends know me for being calm, reserved, with occasional outbreaks of surreal humor and extreme silliness.
One such incident occurred a late last year, and was posted on grouply prior to them being bought out by Oodle and then shut down. I’m reconstructing the post here.
During the usual silliness and semi-RP in Elf Clan’s group chat, Bryster Shan chose to joke about dropping 30 tons of rotten cabbages on my island. After that, I decided to get back at him (with encouragement from a certain little Dwagon)!
It was two days before he noticed what had happened, and the whole thing had to be pointed out to him. With some subtle, not-so-subtle, and blatantly overt hints, we finally got Bryster to take a look at what had happened to his Tavern!
- Zauber Paracelsus: NUCLEAR DRAGON FART!!!!!!!!!!
- Scotsgraymouser Janus: EEEP
- Cy all: WOOOP WOOOP WOOOP
- Scotsgraymouser Janus: NUCLEAR CABBAGE FART BACK
- Cy all: HALP! WE GOT NUKULAR CROSSFIRE!
- Bryster Shan: I see the cabbage thing is spreading. I love being a trend-setter.
- Cy all: CAN SOMEONE PLEASE CALM THE FIRE DOWN?
- Cy all: XD
- Zauber Paracelsus: Oh yeah, I saw you’ve got a huge cabbage hoard in yer bar!
- Zauber Paracelsus: MWAHAHAHAHA
- Scotsgraymouser Janus: OOOH PHEWIE!!
- Cy all: hehehe
- Scotsgraymouser Janus: you making Rubens Bryster?
- Bryster Shan: Huh?
- Zauber Paracelsus: MWAHAHAHAHA
- Scotsgraymouser Janus: Sandwiches
- Scotsgraymouser Janus: saukraut?
- Scotsgraymouser Janus: sigh
- Bavarin Fleetfoot: That would be with sauerkraut. Made with cabbage.
- Bavarin Fleetfoot: On caroway rye I believe
- Bryster Shan: Ham or cheese?
- Scotsgraymouser Janus: Swiss
- Scotsgraymouser Janus: with Thousand island dressing
- Bavarin Fleetfoot: Ham AND cheese innit??
- Zauber Paracelsus: Hey Bryster, guess what Snoots said to me yesterday?
- Bryster Shan: ‘Hello’ ?
- Zauber Paracelsus: he said ”Revenge is a dish best served cold”
- Zauber Paracelsus: or in this case, ROTTEN and SMELLY
- Zauber Paracelsus: MWAHAHAHAHAHA
- Bryster Shan: Oh right! Comes in next week.
- Zauber Paracelsus: jeeze, we’ve tried both subtle and overt hints with ya,
- Zauber Paracelsus: GO LOOK AT THE TAVERN!!!
- Zauber Paracelsus: MWAHAHAHAHAHA
- Bryster Shan: Good grief.
- Zauber Paracelsus cackles maniacally
- Cy all: hehehe
- Bryster Shan: Oh bu**er!
- Scotsgraymouser Janus: hehehehe
- Bavarin Fleetfoot: What’d I say? Hooligans and ruffians they is! I told ya… ;)
- Bryster Shan: Looks like a scene from Aliens.
- Scotsgraymouser Janus: LOL
- Scotsgraymouser Janus: wait till they get RIPE
- Zauber Paracelsus rolls on the floor, laughing his fat scaley a*** off
- Scotsgraymouser Janus: giggles insanely
- Zauber Paracelsus: Good thing I thought to take PICTURES :D :D :D https://picasaweb.google.com/ZauberExonar/PrankOnBryster
- Scotsgraymouser Janus: hahaha, i was so NOT THERE
- Scotsgraymouser Janus: nope
- Scotsgraymouser Janus: nowhere near
- Zauber Paracelsus: MWAHAHAHAHA
- Bavarin Fleetfoot: Oh my… The thousand year Elf/Dragon War begins…
- Bavarin Fleetfoot hides.
- Scotsgraymouser Janus: ohhh ^^
- Bryster Shan: Does anyone have any last words to say to Zauber?
- Bavarin Fleetfoot: Is that a pot of cabbage stew there where Snoot’s bowl of rum was?
- Scotsgraymouser Janus: mm..how about
- Scotsgraymouser Janus: GET ‘EM ZAUBER!!
- Scotsgraymouser Janus: wuahahaha
- Bavarin Fleetfoot quickly runs to take pictures of the Elven and Dragon lands before they both become glowing smoking craters.
- Bryster Shan: And I was right in the middle of making a special dragon brew.
- Bavarin Fleetfoot: This will be important historical documentation when the younglings ask “What ever happened to dragons and elves, gran’pa?”
- Scotsgraymouser Janus: yes..NOTECARD THIS TIME
- Scotsgraymouser Janus: put it in scrolls
- Bryster Shan: ”Well, the Dragons got a bit out of order and the Elves roasted them on spits.
- Scotsgraymouser Janus: let bards sing of it[04:53 PM]
- Zauber Paracelsus scorches Bryster with dragonfire
- Scotsgraymouser Janus: again
- Scotsgraymouser Janus: PHEW!!
- Bryster Shan: That Zauber is a dead dragon. THat Dragon is no more. THat Dragon gone and snuffed it.
- Bavarin Fleetfoot: The epic tale of how the elves and dragons became naught but memory… *shakes head sadly and sits the younglings down for story time*
- Scotsgraymouser Janus: it all started with VEGETABLES
- Zauber Paracelsus releases the destructive radioactive flatulance inside of the Forrestral Tavern
- Bavarin Fleetfoot: “This is why we EAT our vegetables instead of playing with them, kids.”
Let this be a lesson to all: never mess with dragons or dwagons!
Public Emails and Spam
I really hate the fact that mailing lists publicly display your email address. I can understand the convenience of having an easy way to directly/privately email other members of the mailing list, but these lists are regularly trawled by spammers.
And although most email providers include spam filtering, it doesn’t really help when your email is attached to an instant messenger account (hotmail, gmail, yahoo). Then you get spam messages in your IMs, which are completely unprotected by the spam filters.
The other thing I hate: when people throw caution to the wind and make no effort with providing even a minimal amount of security.
LSL Memory Usage: Phlox vs LSO vs Mono
One of the big advantages for the Phlox script engine at InWorldz is that LSL scripts run under it use significantly less memory than they do under the LSO and Mono engines in Second Life.
For about two years now, I’ve been showing some memory usage stats that measure the memory use differences between Phlox, LSO, and Mono. Those measurements, however, are from two years ago, when Phlox was still in beta testing. So today, I’ve decided to take some fresh stats.
The original script was a proprietary one I wrote for one of my products, so I wasn’t inclined towards releasing it for others to confirm my results. So, for this test I am using a public domain script I received back in 2008, a particle script based on code written by Ama Omega and Jopsy Pendragon. This script is heavier than the original one I used, so the results will be much different than the original’s.
Memory usage is reported by executing llSay(0, (string)llGetUsedMemory()); at the end of the script’s state_entry event. But, because LSO always reports memory usage as 16384 bytes (see notes below), I substituted llGetUsedMemory() with llGetFreeMemory() for LSO tests, taking the reported value and subtracting it from 16384 to get the correct value.
If you would like to test the scripts to see for yourself, I’ve packaged them up and made them available for download. Here are the results:
- Mono: 13308
- LSO: 3946
- Phlox: 3124
As you can see, running the script under Mono uses substantially greater memory than it would under LSO or Phlox. But, this script can be stripped down to its bare essentials, by removing all the handling code for the particle system and stripping it all down to just a single call to llParticleSystem with a raw list. To get the raw list, I took the processed list that is passed to llParticleSystem and fed it into iwMakeNotecard to get the raw list values, and plugged those in.
- Mono: 4388
- LSO: 1372
- Phlox: 473
In this test, the script is substantially lighter: 3x smaller under Mono and LSO, and 6.6 times smaller under Phlox. But what about overhead, where each script has a certain baseline amount of memory that it uses? That’s easy to measure. The next test strips out the llParticleSystem call, and does nothing but report memory usage:
- Mono: 3364
- LSO: 221
- Phlox: 74
LSO and Phlox are both substantially smaller with this bare-minimum test, but Mono is only about a kilobyte smaller compared to the prior test, and is several times larger than LSO and Phlox.
So, as you can see, Phlox has much better memory usage than the Mono engine, though LSO’s memory usage is not actually much better (read the notes below).
Phlox is designed for high performance and efficient memory usage, allowing you to do more with your scripts without having to worry as much about lag. Contrast to Second Life, where Linden Lab is attempting to impose more limits on scripts rather than trying to improve their system.
I honestly do hope that Linden Lab does turn around and try to make some common sense changes to their system, but continual disappointments have given me a rather cynical opinion of the lab.
- LSO Memory Usage: Above I noted that I had to use llGetFreeMemory and subtraction in order to obtain the memory usage for the LSO engine. Linden Lab’s reasoning for this behavior with llGetUsedMemory is that all LSO scripts, no matter how much memory they are actually using, will always take up 16 kilobytes of memory.
- Dynamic Allocation: Phlox and Mono use a technique called Dynamic Allocation, where they only use the amount of memory they actually need. So, instead of using up 64kb of memory for every script, Phlox and Mono scripts just use what they’re actually using, with 64kb only serving as a maximum on how much memory they can use.
- Bytecode Sharing: This is another memory-saving technique that Phlox and Mono use. The “bytecode” is the compiled version of a script that gets executed and run. If you have 20 copies of the same script rezzed out, the bytecode is shared amongst them, substantially reducing the memory used. LSO doesn’t use bytecode sharing, so 20 copies of the same LSO script will use the memory of 20 copies instead of 1 copy.
The Original Tests from 2010:
The original tests had different results than the one above: llGetUsedMemory was not available in InWorldz at the time, (and possibly not Second Life either), so llGetFreeMemory was used for all tests, and the subtraction was performed within the script code. The testing script was a proprietary one for one of my products, so it will not be released. I will note, however, that it was lighter than the one used in the initial test, and the optimized version of it was heavier than the one above test. The minimal test was roughly the same, with slightly more memory usage due to the use of in-code subtraction. Here are the results:
- Mono: 9308
- LSO: 2220
- Phlox: 2113
- Mono: 5916
- LSO: 932
- Phlox: 632
- Mono: 3360
- LSO: 228
- Phlox: 80