I got some feedback about the say vs linked message tests I did the other day.
- Arito Cotton suggested I shouldn't use
LINK_ALL_OTHERS, but address the prim I wanted to talk to specifically. As the object had only one prim to begin with, I didn't think this would matter, but I'll give it a whirl. - CrystalShard Foo suggested using
llGetTime()instead ofllGetWallclock(). The big yellow warning scared me off ofllGetTime()before I read the "This timer should be used for performance-related uses only" at the end. - fluffy suggested I should optimize my script by batching up the messages and sending them in single says. Unfortunately the really slow exchange is an A → B → A → B pattern. Really I need to speed it up by revising the protocol so it only needs one A → B exchange, which has nothing to do with
llSay()versus linked messages.
So here's a new script:
default {
touch_start(integer total_number) {
integer i;
llOwnerSay("starting timer");
llResetTime();
for (i = 0; i < 10000; i++) {
llSay(1234, "hi this is my message");
}
float tSays = llGetAndResetTime();
for (i = 0; i < 10000; i++) {
llMessageLinked(1, 0, "hi this is my message", NULL_KEY);
}
float tLinks = llGetAndResetTime();
for (i = 0; i < 10000; i++) {
"hi this is my message";
}
float tNoop = llGetTime();
llOwnerSay("Says: " + (string) tSays);
llOwnerSay("Links: " + (string) tLinks);
llOwnerSay("Noop: " + (string) tNoop);
}
}
that yields new output:
[0:45] timer: starting timer
[0:56] timer: Says: 279.611328
[0:56] timer: Links: 276.838348
[0:56] timer: Noop: 108.153099
that shows pretty much the same thing.