sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Add VProf to frame functions

Open Wend4r opened this issue 3 years ago • 1 comments

I was wondering how much SM slows down the server. The added VProf will only be used during profiling. Maybe someone will come in handy.

Сan run profiling via

sm prof start

and stop with the output of statistics in vprof.log

sm prof stop

con_logfile "vprof.log"
sm prof dump vprof
con_logfile ""

Wend4r avatar Jan 07 '22 16:01 Wend4r

Did you find out anything interesting regarding SM's performance using these scopes? I don't like adding a call to those hot paths which are noops 99% of the time. It might be fine to add the ENTER_SCOPE and EXIT_SCOPE macros, but don't set VPROF_ENABLED by default, but add a new flag for profiling sourcemod to the configure.py script. So you can enable vprof support in your local build easily if you need it, but don't have it in the production builds.

I might overestimate the impact of this though.

peace-maker avatar Jul 11 '22 21:07 peace-maker

I agree with Peace-Maker, but regardless, am closing this due to lack of response.

psychonic avatar Dec 28 '22 21:12 psychonic