amxmodx profiler
2 Attachment(s)
This is a profiler built into amxmodx's core - it really is only useful to people trying to find bottlenecks in their plugins.
What is a profiler? It basically tells you how long your plugin spends executing stuff. To install it, just replace the amxmodx_mm_i386.so or amxmodx_mm.dll files (remember to backup your old ones) with the provided binaries. You do not need to recompile any plugins or change any modules. Then configure plugins to be profiled like you would to get plugins debugged. There is a new cvar, "amx_profile", its configuration is identical to "amx_debug": 0 = no plugins will be profiled 1 = only specified plugins will be profiled (default) 2 = all plugins will be profiled To specify a plugin for profiling (for amx_profile mode 1), open up plugins.ini, and after the plugin name, add "profile". For example, "admin.amxx" would become "admin.amxx profile" Note: You cannot profile a plugin in debug mode. When a plugin is being profiled, there is a very slight overhead. It should be unnoticeable, and you should be able to profile plugins on a production environment. At map change, all plugins that are being profiled will get their profile data appended to amxmodx/data/profiles/<pluginname.amxx>.txt The profiler will read the time it takes to execute native calls, public function calls (from forwards), and function calls (direct public function / stock function calls). Additionally, it provides two new natives (they are not available in amxmodx's official core) to allow you to profile special chunks of code yourself. Documentation for these is available in the "profiler.inc" file. Source is available here Any issues with this version post here, do not file a bug report for it. Edit: New version for 1.8.2 and bugs fixed is available here: https://forums.alliedmods.net/showpo...0&postcount=87 |
Re: amxmodx profiler
Here's an example profile report from admincmd.amxx
Code:
date: Fri Feb 29 01:42:55 2008 map: de_dust Note that it doesn't add up recursive calls. For example: If function a() calls function b(), for the duration that b() is executing, the profiler for function a() is not keeping track of time. As soon as b() stops executing, a() will continue tallying up time. |
Re: amxmodx profiler
neat!
|
Re: amxmodx profiler
sawce if I could steal that trophy of yours and re-award it to you - I would.
It's that amazing. |
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Your karma status could not be more accurate.
|
Re: amxmodx profiler
Irrefutable proof that there is nothing that sawce cannot do!
I need to steal this for SourceMod. |
Re: amxmodx profiler
wow this is awsome
|
Re: amxmodx profiler
would it be possible for you to make something that logs at which function ( or maybe even the certain portion of the function ) a certain plugin is when the server crashes or reboots
|
Re: amxmodx profiler
use binlogging
|
Re: amxmodx profiler
from the data gathered, how do i tell if particular plugins causing lagness etc on my server?
|
Re: amxmodx profiler
Really this is only meant for plugin developers finding bottlenecks, however if you must, then you could try to add up all the time, and whichever plugin takes the longest to execute would likely be it. However, take these values with a grain of salt; of course something like admincmd would take very little CPU compared to a plugin like gungame.
|
Re: amxmodx profiler
Bow to the almighty sawce.
|
Re: amxmodx profiler
Is there a 1.8.1.3679 build of this?
Note: I'm not entirely sure but this seems to crash when csx loads, can anyone else verify this? |
Re: amxmodx profiler
it might be related to the absolutely retarded thing csx does with csstats.amxx, I'll look into it sometime soon
|
Re: amxmodx profiler
I'd appreciate it if someone who isn't lazy would make a comparison of get_players() and looping over each slot, but I'll understand if I get ignored.
|
Re: amxmodx profiler
Someone who isn't lazy? Huh? I'm lazy, so I guess I shouldn't reply.
|
Re: amxmodx profiler
It would depend on what checks are done. I'm fairly certain get_players would technically be faster, but the difference should be negligible so it should come down to preference. I still would use the separate checks because I hate get_player's syntax.
Also, I'm too lazy to actually check, be glad you got theory out of me. |
Re: amxmodx profiler
sawce: http://forums.alliedmods.net/showthread.php?t=57560
I'm lazy, not stupid or forgetful. Thanks anyway. I'm with you, I'm never going to use get_players() regardless of the results. This post sparked my curiosity. What's your take on get_players() vs. incrementing a variable? (rhetorical question) BAILOPAN, I can say with complete certainty that you're not lazy. All you have to do is look at what you've accomplished, both with this project and (from what very little I know about it) at school. If you're asking why I requested the help of someone who isn't lazy; I recognise that I should do it myself, but I can't be bothered. I did search Google for existing benchmarks of get_players(), but it only found two benchmarks on the entire site - and not this one. Of course, I've now spent more time making this post (23 minutes) than it would have taken to install the new binary and write the benchmark script. |
Re: amxmodx profiler
I can't seem to narrow this down, but it seems ether when the TS Module is enabled, or the ArrayX is enabled. The server crashes upon start up.
|
Re: amxmodx profiler
My money would be on the TS stats garbage doing it, especially if it uses the zombie plugin to calculate ranking like CSX does.
edit: ArrayX is terribad, don't use anything associated with rukia. |
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Merged in changes from 1.8.1, haven't had a chance to test so the old binaries are still there if needed.
|
Re: amxmodx profiler
I want to give this a spin, but it just crashes immediately. I tested both binaries, same result. I run the server and it crashes as soon as the program launches.
When I switch back to the original binary, works fine. Also note: I disabled all 3rd party plugins. Informations: Code:
Metamod version 1.19 |
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Nope. I imagine running AMXX 1.7.x would work, but... I'm lazy.
|
Re: amxmodx profiler
nice work
|
Re: amxmodx profiler
Thanks sawce, exactly what i needed to see if lame plugins result from my n00b coding skills.
|
Re: amxmodx profiler
Was anyone able to use it? I still get instant crashes on both versions, on MM 1.19 and MM 1.19p32, in 2 different system (Windows XP and Windows 7).
|
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
It works fine for me. Both. ( Tested under windows xp, mm1.19p32 )
|
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Ah using the natives. You're right it crashes my server too. Just after StopProfile() call. Most likely it crashes when the profiler object is destroyed because value is well given.
|
Re: amxmodx profiler
Sawce, any chance on updating this to not crash with csx (or any other module that uses a <mod>stats.amxx plugin)?
|
Re: amxmodx profiler
linux binary is crashing for me on startup too...
Quote:
|
Re: amxmodx profiler
Quote:
Quote:
Here's an example, but your mileage may vary depending on your specific applications. If you give me some ideas, then I might test them. According to the results of this test, get_players() is one order of magnitude faster than iterating through each client. I had 32 bots connected to my server at the time of this test. Code:
date: Thu Apr 16 23:59:26 2009 map: de_dust PHP Code:
|
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Quote:
|
Re: amxmodx profiler
Quote:
Caching the results of cient_authorized() and client_disconnect() increases the speed of IterateThroughAllPlayers() tremendously. Now, the get_players() method is one order of magnitude slower than iterating through each player. Here are the results: (NOTE: the previous post had 10,000 iterations, this had 1,000,000 iterations) Code:
32 BOTS, CACHED CONNECT/DISCONNECT PHP Code:
|
All times are GMT -4. The time now is 21:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.