0IInoaII0 Posted June 2, 2020 Share Posted June 2, 2020 Is there any predefined fucntion or any way to check compilation time of a script in viewer. Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted June 2, 2020 Share Posted June 2, 2020 (edited) No, but you can enable the LSL Preprocessor if you're on Firestorm. It adds a comment like this to the source code: //program_version Firestorm-Releasex64 6.3.2.58052 - Wulfie Reanimator //last_compiled 06/02/2020 11:13:25 You can find it in Preferences > Firestorm > Build 1 > Enable LSL Preprocessor Edited June 2, 2020 by Wulfie Reanimator Link to comment Share on other sites More sharing options...
Eth3l Posted June 2, 2020 Share Posted June 2, 2020 Hi there, I wrote some example scripts for you, so you can better monitor your memory use. I hope these examples get you closer to write more efficient code. Cheers. V1 == - displays the target function's memory use. V2 == - displays the target function's memory use & - displays max memory limit. V2 == - sets the memory limit - displays the target function's memory use & - displays the predefined memory limit. // V1 // == testFunction() { key objOwnerKey = llGetOwner(); key objTriggerKey = llDetectedKey(0); if (objOwnerKey == objTriggerKey) { llOwnerSay("owner UUID: " + (string)objOwnerKey); } } default { touch_end(integer n) { llScriptProfiler(PROFILE_SCRIPT_MEMORY); testFunction(); llScriptProfiler(PROFILE_NONE); llOwnerSay("Memory used: " + (string)llGetSPMaxMemory() + " bytes."); } } // V2 // == testFunction() { key objOwnerKey = llGetOwner(); key objTriggerKey = llDetectedKey(0); if (objOwnerKey == objTriggerKey) { llOwnerSay("owner UUID: " + (string)objOwnerKey); } } default { touch_end(integer n) { llScriptProfiler(PROFILE_SCRIPT_MEMORY); testFunction(); llScriptProfiler(PROFILE_NONE); llOwnerSay("Memory used: " + (string)llGetSPMaxMemory() + " bytes."); llOwnerSay("Memory limit: " + (string)llGetMemoryLimit() + " bytes."); } } // V3 // == testFunction() { key objOwnerKey = llGetOwner(); key objTriggerKey = llDetectedKey(0); if (objOwnerKey == objTriggerKey) { llOwnerSay("owner UUID: " + (string)objOwnerKey); } } default { touch_end(integer n) { llSetMemoryLimit(5000); llScriptProfiler(PROFILE_SCRIPT_MEMORY); testFunction(); llScriptProfiler(PROFILE_NONE); llOwnerSay("Memory used: " + (string)llGetSPMaxMemory() + " bytes."); llOwnerSay("Memory limit: " + (string)llGetMemoryLimit() + " bytes."); } } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now