This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

amxmodx profiler


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-14-2014 , 07:02   Re: amxmodx profiler
Reply With Quote #1

Quote:
Originally Posted by avril-lavigne View Post
Version for 1.8.2 doesnt work with 1.8.2 - server crash ....I tried with http://sourcemod.gameconnect.net/fil...se-windows.zip


waiting for 1.8.3 ....
I dont think its a version to the fact oficial version of 1.8.2, it was probably for one of beta verions of 1.8.2
Why? look when first post was edited, in 2011. The oficial 1.8.2 version was only released in 2013.
__________________
Jhob94 is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 11-14-2014 , 23:07   Re: amxmodx profiler
Reply With Quote #2

oh no I was stupid. pressed wrong shortcut for hlds
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 11-14-2014 at 23:46.
avril-lavigne is offline
xkp
Member
Join Date: Jan 2015
Location: AlliedLand
Old 01-31-2015 , 13:55   Re: amxmodx profiler
Reply With Quote #3

we must wait i think for official 1.8.3 and we will see if they will implent it or it will remain standalone version
__________________
xkp is offline
Send a message via Skype™ to xkp
JAYDEE10
New Member
Join Date: Jan 2023
Old 01-17-2023 , 06:22   Re: amxmodx profiler
Reply With Quote #4

Brilliant, this is amazing.
__________________

Last edited by JAYDEE10; 01-22-2023 at 12:18.
JAYDEE10 is offline
goaescortssupriya
New Member
Join Date: Aug 2023
Location: goa
Old 08-06-2023 , 14:34   Re: amxmodx profiler
Reply With Quote #5

great
goaescortssupriya is offline
spiderbites
Senior Member
Join Date: Nov 2007
Old 03-25-2008 , 05:07   Re: amxmodx profiler
Reply With Quote #6

from the data gathered, how do i tell if particular plugins causing lagness etc on my server?
spiderbites is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 04-17-2009 , 01:08   Re: amxmodx profiler
Reply With Quote #7

Quote:
Originally Posted by Lee View Post
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.
Ok.

Quote:
Originally Posted by sawce View Post
I'm fairly certain get_players would technically be faster
You are correct, sir.


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
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                  register_plugin |          1 | 0.000001 / 0.000001 / 0.000001
   n |                   get_maxplayers |          1 | 0.000000 / 0.000000 / 0.000000
   n |                  register_srvcmd |          1 | 0.000066 / 0.000066 / 0.000066
   n |                       server_cmd |          1 | 0.000003 / 0.000003 / 0.000003
   n |                is_user_connected |     320000 | 0.096525 / 0.000000 / 0.000064
   n |                      get_players |      10000 | 0.006736 / 0.000001 / 0.000042
   p |                           cmd_go |          1 | 0.006293 / 0.006293 / 0.006293
   p |                      plugin_init |          1 | 0.000002 / 0.000002 / 0.000002
   f |         IterateThroughAllPlayers |      10000 | 0.108971 / 0.000010 / 0.000211
   f |                    UseGetPlayers |      10000 | 0.009358 / 0.000001 / 0.000042
0 natives, 0 public callbacks, 2 function calls were not executed.

TOTAL TIME FOR:
	IterateThroughAllPlayers
		0.205496
	UseGetPlayers
		0.016094
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Get Players"
#define AUTHOR    "stupok"
#define VERSION    "1.0"

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_iMaxPlayers get_maxplayers()
    
    
register_srvcmd"go""cmd_go" )
}

public 
cmd_go()
{
    for( new 
010000i++ )
    {
        
IterateThroughAllPlayers()
    }
    
    for( new 
010000i++ )
    {
        
UseGetPlayers()
    }
    
    
server_cmd"quit" )
}

IterateThroughAllPlayers()
{
    for( new 
1<= g_iMaxPlayersi++ )
    {
        if( 
is_user_connected) )
        {
            
//
        
}
    }
}

UseGetPlayers()
{
    static 
aPlayers[32], iPlayersNumid
    
    get_players
aPlayersiPlayersNum"" )
    
    for( new 
0iPlayersNumi++ )
    {
        
id aPlayers[i]
    }

__________________

Last edited by stupok; 04-17-2009 at 01:12.
stupok is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-17-2009 , 16:12   Re: amxmodx profiler
Reply With Quote #8

Quote:
Originally Posted by stupok View Post
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.
Try saving whether a player is connected into a global during client_authorized and client_disconnect.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
stupok
Veteran Member
Join Date: Feb 2006
Old 04-18-2009 , 12:55   Re: amxmodx profiler
Reply With Quote #9

Quote:
Originally Posted by Emp` View Post
Try saving whether a player is connected into a global during client_authorized and client_disconnect.
Ok.

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

date: Sat Apr 18 11:46:00 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                  register_plugin |          1 | 0.000001 / 0.000001 / 0.000001
   n |                   get_maxplayers |          1 | 0.000000 / 0.000000 / 0.000000
   n |                  register_srvcmd |          1 | 0.000059 / 0.000059 / 0.000059
   n |                       server_cmd |          1 | 0.000003 / 0.000003 / 0.000003
   n |                      get_players |    1000000 | 0.660214 / 0.000001 / 0.001794
   p |                client_authorized |         32 | 0.000019 / 0.000001 / 0.000001
   p |                client_disconnect |         32 | 0.000010 / 0.000000 / 0.000000
   p |                           cmd_go |          1 | 0.623259 / 0.623259 / 0.623259
   p |                      plugin_init |          1 | 0.000002 / 0.000002 / 0.000002
   f |         IterateThroughAllPlayers |    1000000 | 0.604227 / 0.000001 / 0.001491
   f |                    UseGetPlayers |    1000000 | 0.934782 / 0.000001 / 0.001892
0 natives, 0 public callbacks, 4 function calls were not executed.

TOTAL TIME FOR:
	IterateThroughAllPlayers
		0.604227
	UseGetPlayers
		1.594996
Here's the plugin:

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Get Players"
#define AUTHOR    "stupok"
#define VERSION    "1.0"

new g_iMaxPlayers
new g_bClientConnected[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_iMaxPlayers get_maxplayers()
    
    
register_srvcmd"go""cmd_go" )
}

public 
cmd_go()
{
    for( new 
01000000i++ )
    {
        
IterateThroughAllPlayers()
    }
    
    for( new 
01000000i++ )
    {
        
UseGetPlayers()
    }
    
    
server_cmd"quit" )
}

public 
client_authorizedid )
    
g_bClientConnected[id] = true

public client_disconnectid )
    
g_bClientConnected[id] = false

IterateThroughAllPlayers
()
{
    for( new 
1<= g_iMaxPlayersi++ )
    {
        if( 
g_bClientConnected[i] )
        {
            
//
        
}
    }
}

UseGetPlayers()
{
    static 
aPlayers[32], iPlayersNumid
    
    get_players
aPlayersiPlayersNum"" )
    
    for( new 
0iPlayersNumi++ )
    {
        
id aPlayers[i]
    }

__________________
stupok is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 04-18-2009 , 16:13   Re: amxmodx profiler
Reply With Quote #10

I noticed something curious, but please keep in mind that I don't know how this profiler works. Maybe this behavior is expected.

The data below shows what happens when a function is called 1 time, 10 times, etc. up to 100 million times. The function is called in a for() loop.

The curiosity is that the "max" time required for one call increases at a rate proportional to the number of total calls.

Code:
date: Sat Apr 18 14:27:33 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |          1 | 0.000002 / 0.000002 / 0.000002
   f |                    UseGetPlayers |          1 | 0.000001 / 0.000001 / 0.000001

date: Sat Apr 18 14:27:57 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |         10 | 0.000006 / 0.000000 / 0.000002
   f |                    UseGetPlayers |         10 | 0.000007 / 0.000001 / 0.000001

date: Sat Apr 18 14:28:04 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |        100 | 0.000045 / 0.000000 / 0.000001
   f |                    UseGetPlayers |        100 | 0.000063 / 0.000001 / 0.000001

date: Sat Apr 18 14:28:13 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |       1000 | 0.000425 / 0.000000 / 0.000001
   f |                    UseGetPlayers |       1000 | 0.000636 / 0.000001 / 0.000001

date: Sat Apr 18 14:28:20 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |      10000 | 0.004230 / 0.000000 / 0.000002
   f |                    UseGetPlayers |      10000 | 0.006582 / 0.000001 / 0.000051

date: Sat Apr 18 14:28:29 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |     100000 | 0.042843 / 0.000000 / 0.000090
   f |                    UseGetPlayers |     100000 | 0.066326 / 0.000001 / 0.000171

date: Sat Apr 18 14:28:38 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |    1000000 | 0.425573 / 0.000000 / 0.000282
   f |                    UseGetPlayers |    1000000 | 0.646957 / 0.000001 / 0.000462

date: Sat Apr 18 14:39:49 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |   10000000 | 4.284324 / 0.000000 / 0.000629
   f |                    UseGetPlayers |   10000000 | 6.440324 / 0.000001 / 0.000622

date: Sat Apr 18 14:48:39 2009 map: de_dust
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                      get_players |  100000000 | 43.063107 / 0.000000 / 0.031469
   f |                    UseGetPlayers |  100000000 | 64.614610 / 0.000001 / 0.001876
__________________

Last edited by stupok; 04-18-2009 at 22:11.
stupok 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 07:36.


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