The script profiler is used by first entering
StartScriptProfiler e.g. at the script command line when running the engine in developer mode. After a while,
StopScriptProfiler is entered and the result is printed to the log, e.g. as follows:
This output shows that explosions are the parts which are taking longest to execute. "global Explode" ist the globally defined script function Explode(). In second place is the impact function of the Superflint, SFLN::Hit. Notice that all execution times of a script function always include the execution time of all subroutines or functions called therein. The time taken in Explode is thus also included in SFLN::Hit. Functions calling themselves recursively will add to the execution time in the same way.
"game DeployPlayer" is a call in the scenario script. "Direct exec" is the sum of all scripts compiled and executed at run time. This may include
eval or menu callbacks.
Notice that scripting functions may not be the only parts causing program execution to slow down. If an object creates large numbers of particles, this can also slow down the game without causing extra scripting execution time. Large numbers of objects would cause similar delays.