Skip to main content

Script Profiler

All games (beta build), CS2 ยท Settings. An on-screen panel that shows how much time per second each script takes and helps find what lowers your FPS.

Also searched as: profiler, script profiler, script lowers fps, script eats fps, lag, fps drop, low fps, which script is slow, script load, performance, ms/s

Where to find it in the menuโ€‹

Settings โ†’ Script Profiler

The page is available:

  • in the beta build of the client โ€” in all games (the common menu profiler, described first);
  • in CS2 โ€” in the regular build, with its own set of settings (see the "CS2" section below).

In the regular build of Dota 2 and Deadlock this page does not exist.

How to enableโ€‹

  1. Menu (Insert) โ†’ Settings โ†’ Script Profiler.
  2. Turn on State. Off by default.
  3. A panel with a table appears on screen. The common profiler panel can be dragged by its header while the menu is open. The CS2 panel stays in place.

What it doesโ€‹

Common profiler (beta build)

  • Measures the time spent by script event handlers and updates the table once every Window seconds.
  • Columns: MS/S โ€” how many milliseconds per second the row takes, AVG โ€” the average time of one call, MAX โ€” the longest call in the window, CALLS/S โ€” how many times per second it is called.
  • The header shows the total script execution time.
  • Group by file: on โ€” one row per script (the sum of all its handlers); off โ€” a separate row for each handler.
  • With grouping by file and the menu open, clicking a row opens the details of that script: handlers and lines of code. โ€น ALL SOURCES returns to the overall list.
  • A long window gives smoother numbers and catches rare spikes; a short one reacts faster, but the numbers jump.

CS2 (regular build)

  • The panel is in the top left corner of the screen and updates once per second. The header shows the total script time in ms/s.
  • Rows are colored by load: red โ€” at or above the "Red above" threshold, yellow โ€” from a quarter of the threshold, green โ€” below that.

Settingsโ€‹

Common profiler (beta build)

SettingTypeDefaultRange / optionsWhat it does
StateToggleOffโ€”Turns on measurements and the panel
Group by fileToggleOnโ€”On โ€” sum per script, off โ€” per handler
Sort byDropdownms / secms / sec, avg ms, max ms, calls / secRow order: total time, average per call, worst spike, call frequency
WindowSlider, s11โ€“10Length of the measurement window
Max rowsSlider155โ€“40How many rows the panel shows
ResetButtonโ€”โ€”Erase the collected statistics and start over

CS2

SettingTypeDefaultRange / optionsWhat it does
StateHeader toggle of the pageOffโ€”Turns on measurements and the panel
Group by fileToggleOnโ€”On โ€” sum per script, off โ€” per handler
Sort byDropdownms / framems / frame, ms / sec, calls / secms / frame โ€” by average call time, ms / sec โ€” by total time, calls / sec โ€” by frequency
Max rowsSlider155โ€“40How many rows the panel shows
Red aboveSlider, ms/s20.1โ€“10Rows more expensive than this value are drawn in red
Header colorColorWhiteโ€”Color of the panel header
ResetButtonโ€”โ€”Erase the collected statistics

FAQโ€‹

There is no "Script Profiler" page. It does not exist in the regular build of Dota 2 and Deadlock: the common profiler is only in the beta build of the client. In CS2 the page is always there.

Which script is slowing down the game? Turn on the profiler, sort by ms / sec and look at the top rows. Turn off the suspicious script and compare FPS in the Watermark.

The numbers keep jumping. Increase the Window (beta build): the measurement becomes longer and the numbers smoother.