Profiling

Learn how to enable and use the built-in Tracy profiler to measure performance across plugins and language modules.

S2-Launcher includes a built-in profiler interface powered by the Tracy C++ profiling library. When enabled, it provides real-time performance data across most language modules and supported plugins. Profiling is intended for developers and debugging purposes — it is disabled by default and should only be enabled when you need it.

Enabling the Profiler

To enable profiling, pass the --profiler flag when launching the game via S2-Launcher:

On Windows:

s2launcher.exe --profiler

On Linux:

./s2launcher --profiler

Combined with other arguments:

s2launcher.exe -dedicated -console +map de_dust2 --profiler

Once the flag is present, the profiler will automatically activate in supported language modules and plugins at startup.

Connecting Tracy

Tracy uses a separate viewer application to collect and display profiling data from the running game.

Download Tracy

Download the latest release from the Tracy GitHub Releases page. Look for the Tracy-<version>.7z archive and extract it.

Run Tracy

Open Tracy.exe from the extracted folder. Tracy will display a list of active profiling sessions — called s2launcher — that are available to connect to.

Connect to Your Session

Double-click your session in the list to connect. Tracy will begin collecting profiling data from the running game in real time.

What You Can Measure

With the profiler enabled, Tracy captures performance data including:

  • Frame timings across the game loop
  • Plugin function call durations — see exactly how long each plugin's hooks and callbacks take
  • Language module overhead — measure the cost of cross-language calls (C#, Python, JavaScript, etc.)
  • Custom zones defined by plugins that have Tracy instrumentation built in

Recommendations

  • Only enable when needed. The profiler adds overhead to the game process. Running it during normal play or on a production server is not recommended.
  • Use the Tracy manual for in-depth guidance on interpreting traces, setting up custom instrumentation, and analyzing bottlenecks. The manual is included in the Tracy release as Tracy.pdf.
  • Run in isolation. For the most accurate measurements, profile with minimal other processes running on the machine.

Troubleshooting

  1. No sessions appear in Tracy:
    • Confirm you passed --profiler to the launcher and that the game started successfully.
    • Ensure Tracy and the game are on the same machine or the same local network (Tracy connects over TCP).
    • Check that your firewall is not blocking Tracy's default port (8086).
  2. Profiler active but no plugin data:
    • Only language modules and plugins that have Tracy instrumentation built in will report data. Third-party libraries without Tracy support will not appear.
  3. Game performance drops with profiler on:
    • This is expected. Tracy's instrumentation has a measurable cost. Disable the --profiler flag for normal use.