Raised This Month: $51 Target: $400
 12% 

Profiling plugins in Sourcemod?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 09-19-2014 , 22:32   Profiling plugins in Sourcemod?
Reply With Quote #1

I'm wanting to start profiling or testing plugins to see how they run and if there's any specific functions I would like to optimize a bit further. (maybe)

Any ideas on how I can do this because I believe the 'plugin_settings.cfg' file was discontinued with the release of Sourcemod 1.6. I did a bit of research but didn't come up with any conclusions.

Thanks,
- Jack
Drixevel is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 09-20-2014 , 03:47   Re: Profiling plugins in Sourcemod?
Reply With Quote #2

The 1.7 branch currently has some profiling hooks that integrates with vprof to get some info. I meant to write up a wiki article on using that and vprof, but I never really got around to it. Someday™.

The general gist is that you use the following console commands:

sm prof start
* do whatever intensive logic you think can be optimized *
sm prof stop
sm prof dump vprof

The vprof output will get spewed to console, so I recommend using con_logfile or -condebug or similar to get output to a file.
__________________
VoiDeD is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-20-2014 , 07:56   Re: Profiling plugins in Sourcemod?
Reply With Quote #3

Unfortunately there are a lot of things that profiler can't quite help you with. For these cases, you would have to develop your own techniques.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 06-02-2016 , 09:57   Re: Profiling plugins in Sourcemod?
Reply With Quote #4

Will the time freeze if the server locks up on high SV ?

Or is this a viable way to "benchmark" ?

PHP Code:
float start GetEngineTime();
heavylogic();
PrintToServer("Benchmark for [%s] %f second(s)","heavylogic",GetEngineTime() - start); 
__________________
ImACow is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-03-2016 , 16:58   Re: Profiling plugins in Sourcemod?
Reply With Quote #5

You should use the profiling API for that, none of the normal time functions have anywhere near enough resolution for timing like that.
__________________
asherkin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 06-04-2016 , 22:33   Re: Profiling plugins in Sourcemod?
Reply With Quote #6

Quote:
Originally Posted by VoiDeD View Post
sm prof start
* do whatever intensive logic you think can be optimized *
sm prof stop
sm prof dump vprof
Last time i tried this my server kept crashing on sm prof start.

Quote:
Originally Posted by asherkin View Post
You should use the profiling API for that, none of the normal time functions have anywhere near enough resolution for timing like that.
Good to know. I never new about this.
__________________
Neuro Toxin is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-05-2016 , 08:52   Re: Profiling plugins in Sourcemod?
Reply With Quote #7

Quote:
Originally Posted by Neuro Toxin View Post
Last time i tried this my server kept crashing on sm prof start.
On what game?
psychonic is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 06-05-2016 , 09:09   Re: Profiling plugins in Sourcemod?
Reply With Quote #8

I just tried: sm prof start: as it's been a while since I last tried.

WIN CS:GO server == dead

Code:
] sm version
SourceMod 1.7.3-dev+5303, by AlliedModders LLC
To see running plugins, type "sm plugins"
To see credits, type "sm credits"
Visit http://www.sourcemod.net/
__________________

Last edited by Neuro Toxin; 06-05-2016 at 09:09.
Neuro Toxin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode