// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Observe two short string-join methods // Not compiled or tested in-world // Setup: Touch as owner. Runs only fifty short words. // Stop / restore: Remove or reset the script to stop the diagnostic. No build properties are changed. // Notes: Tiny timing values can be dominated by scheduling and resolution. This is an observation tool, not a reliable cross-engine benchmark or optimization verdict. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; list words=[]; integer i; for(i=0;i<50;++i)words += ["word"]; llResetTime(); string joined=""; for(i=0;i<50;++i) { if(i)joined+=" "; joined+=llList2String(words,i); } float concatTime=llGetTime(); llResetTime(); string dumped=llDumpList2String(words," "); float listTime=llGetTime(); llOwnerSay("Concatenation seconds: "+(string)concatTime+"; list join seconds: "+(string)listTime+"; equal output="+(string)(joined==dumped)); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }