// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Measure a small list’s memory footprint // Not compiled or tested in-world // Setup: Touch as owner; no configuration required. // Stop / restore: Remove or disable; it changes no object or parcel properties. // Notes: A teaching measurement, not a benchmark of all scripts. Garbage collection and simulator engine differences can alter readings. Uses only 100 small entries and clears them afterward. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner()) return; list sample=[]; integer before=llGetUsedMemory(); integer i; for(i=0;i<100;++i)sample += ["record-"+(string)i]; integer after=llGetUsedMemory(); llOwnerSay("100-entry list observed memory delta: "+(string)(after-before)+" bytes; entries="+(string)llGetListLength(sample)); sample=[]; } changed(integer flags) { if(flags & CHANGED_OWNER) llResetScript(); } }