Here are some rough benchmarks of intra-object communication methods performed by
HughPerkins.
Should be noted that script delays will effect the code as will minimum event delay.--BW
llMessageLinked: About 40 messages per second, when sending in bursts of 5 with
llSleep(0.1) between bursts.
Strangely, sending as a single burst *reduced* the receive speed, and also caused a lot of message loss, presumably because the events queue in the receiving script was flooded.
Presumably the sending is *very* fast and not at all delayed, but the receiving script (a) is blocked by messages being added to the queue (?) and (b) is somewhat more delayed than the sending script, or possibly just (a).
IntraSL Email: Send delay: 20 seconds
Receive delay: about 1 second
llParseString2List: About 40 commands per second.
llStringToBase64/llBase64ToString: 3 to 4 commands per second(!). See the comments at
llStringToBase64 for details.
Appendix: core scripts used for benchmarking
llMessageLinked, Sender script:
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched.");
integer i;
for( i = 0; i < 40; i++ )
{
llMessageLinked( LINK_SET, 0, (string)i, "" );
llMessageLinked( LINK_SET, 0, (string)i, "" );
llMessageLinked( LINK_SET, 0, (string)i, "" );
llMessageLinked( LINK_SET, 0, (string)i, "" );
llMessageLinked( LINK_SET, 0, (string)i, "" );
llSleep(0.1);
}
}
}
llMessageLinked, Receiver Script:
integer iNumReceived = 0;
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
link_message( integer sendernum, integer num, string message, key id )
{
iNumReceived++;
if( iNumReceived % 5 == 0 )
{
llSetText( (string)iNumReceived, <1,1,1>, 1.0 );
}
}
}
llParseString2List:
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched.");
integer i;
string sTestString = "TEST-=-" + (string)llGetKey() + "-=-1-=-asdfsdf";
for( i = 0; i < 200; i++ )
{
list args;
args = llParseString2List( sTestString, ["-=-"], [] );
if( i % 5 == 0 )
{
llSetText( (string)i, <1,1,1>, 1.0 );
}
}
}
}