realXtend/naali — pull request #403 by jonnenauha (2012-03-02 10:52:25+00:00)
Title: Script profiling

Commit message copy-pasted: (because im lazy :)

New overloadable function in IScriptInstance that returns map of debug data. Profiler shows this information in a new 'Scripts' tab. This shows various info about the object tree of the script, easy to read if scripts are leaking mem as shows deltas for changes and totals for objects. Python scripts atm do not return any debug data, this has to be implemented if it is desired (and handled in profiler if the return data map has different keys).

---

This is the initial script profiling that we can do easily. We can add more information to the dump functions in the classes that implement IScriptInterface and to the ui when we want. I found this pretty useful already and found memory leaks from my scripts. You can leave the profiler open and do actions that your script handles, over time you see that object count grows. For well behaved scripts you can see it might preserve objects but after some time carbage collector removes them from the object tree.

![Screenshot](http://dl.dropbox.com/u/3589544/profiler-scripts.png)
http://dl.dropbox.com/u/3589544/profiler-scripts.png