Profiling
Turn on the S2-Launcher profiler, which reports the timing of Plugify, its language modules and plugins to the engine's VProf.
S2-Launcher can report how long Plugify spends on its work to the profiler built into the engine, VProf. Profiling is meant for developers and debugging. It is off by default.
Turning it on
Pass --profiler when you start the launcher, together with the other arguments:
The Runtime host reads the same argument from the command line of cs2.
What gets measured
With the profiler on, Plugify passes its timing zones to VProf:
- the work of the plugin manager: loading, the update every server frame, unloading;
- calls into language modules and plugins, from the modules that report them;
- zones that plugins open themselves through their language module.
Each zone is filed in VProf under a budget group named after the module that opened it, so the time of Plugify is shown next to the time of the engine. Read the results with the engine's VProf tools.
Without --profiler the zones are not reported and cost close to nothing.
Recommendations
- Turn it on only when needed. Profiling adds overhead, so don't keep it on a production server.
- Compare with the profiler off. Measure the same scene with and without a plugin to see what it costs.
Troubleshooting
- No Plugify zones in VProf: check that
--profileris in the start arguments and that Plugify loaded (plg --version). - Some plugins don't show up: only modules and plugins that report zones appear. A plugin that opens no zones of its own is seen through the calls of its language module.
- The server got slower: this is the cost of profiling. Start without
--profilerfor normal use.