Difference between revisions of "LlScriptProfiler"
m |
m |
||
Line 12: | Line 12: | ||
===Mono=== | ===Mono=== | ||
Use this function with [[PROFILE_SCRIPT_MEMORY]] to enable memory profiling at a sever script performance penalty. Use it with [[PROFILE_NONE]] to disable profiling. During and after a profiling run llGetSPMaxMemory will return the most memory used at any one time. | Use this function with [[PROFILE_SCRIPT_MEMORY]] to enable memory profiling at a sever script performance penalty. Use it with [[PROFILE_NONE]] to disable profiling. During and after a profiling run [[llGetSPMaxMemory]] will return the most memory used at any one time. | ||
===LSO=== | ===LSO=== | ||
Line 20: | Line 20: | ||
|caveats= | |caveats= | ||
*Scripts compiled to LSL can not be profiled for memory use. | *Scripts compiled to LSL can not be profiled for memory use. | ||
*The profile state will reset to PROFILE_NONE if: | *The profile state will reset to [[PROFILE_NONE]] if: | ||
** the object the script is in is de-rezed, rezed or changes regions (via region cross or teleport) | ** the object the script is in is de-rezed, rezed or changes regions (via region cross or teleport) | ||
** the region that object with the script is in shuts down or restarts | ** the region that object with the script is in shuts down or restarts | ||
** if the script is reset or taken to or from inventory | ** if the script is reset or taken to or from inventory | ||
* There is up to 100x performance penalty | * There is up to 100x performance penalty to the script being profiled (but not the region). | ||
|constants=PROFILE_SCRIPT_MEMORY | |constants={{{!}} class='sortable' {{prettytable}} | ||
{{!}}- {{hl2}} | |||
! Constant | |||
! Description | |||
{{!}}- | |||
{{!}} [[PROFILE_NONE]] | |||
{{!}} Disables profiling | |||
{{!}}- | |||
{{!}} [[PROFILE_SCRIPT_MEMORY]] | |||
{{!}} Enables memory profiling | |||
{{!}}} | |||
|examples= | |examples= | ||
Calling llScriptProfiler can look like this: | Calling llScriptProfiler can look like this: | ||
Line 35: | Line 45: | ||
</lsl> | </lsl> | ||
|helpers | |helpers | ||
|also_functions=llGetSPMaxMemory | |also_functions={{LSL DefineRow||[[llGetSPMaxMemory]]}} | ||
|also_events | |also_events | ||
|also_tests | |also_tests |
Revision as of 11:41, 15 April 2011
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llScriptProfiler( integer flags );??? | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Enables or disables the scripts profiling state.
• integer | flags |
Specification
This function's behavior is dependent upon the VM the script is using. Mono is the new VM, LSO is the old VM. The big difference between between Mono and LSO is that Mono scripts run faster and can utilize four times more memory.
Mono
Use this function with PROFILE_SCRIPT_MEMORY to enable memory profiling at a sever script performance penalty. Use it with PROFILE_NONE to disable profiling. During and after a profiling run llGetSPMaxMemory will return the most memory used at any one time.
LSO
This function has no effect for scripts not compiled to Mono.
Constant | Description |
---|---|
PROFILE_NONE | Disables profiling |
PROFILE_SCRIPT_MEMORY | Enables memory profiling |
Caveats
- Scripts compiled to LSL can not be profiled for memory use.
- The profile state will reset to PROFILE_NONE if:
- the object the script is in is de-rezed, rezed or changes regions (via region cross or teleport)
- the region that object with the script is in shuts down or restarts
- if the script is reset or taken to or from inventory
- There is up to 100x performance penalty to the script being profiled (but not the region).
Examples
Calling llScriptProfiler can look like this: <lsl> llScriptProfiler(PROFILE_SCRIPT_MEMORY) my_func(); llScriptProfiler(PROFILE_NONE) llOwnerSay("This script used at most " + (string)llGetSPMaxMemory() + " bytes of memory during my_func.");
</lsl>See Also
Functions
• | llGetSPMaxMemory |