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

amxmodx profiler


Post New Thread Reply   
 
Thread Tools Display Modes
stupok
Veteran Member
Join Date: Feb 2006
Old 04-18-2009 , 16:13   Re: amxmodx profiler
Reply With Quote #41

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
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-20-2009 , 03:55   Re: amxmodx profiler
Reply With Quote #42

Stupok, good work with the profiling. Let me just say this:

While caching variables is faster no matter what, the comparison is not fair. That because you just have 32 to client_authorized/client_disconnect. On a "real" situation, that number would grow bigger during the lifetime of the plugin (even if you don't use the cached values). Another point is that forwards are called module side. So you can't profile with amxmodx profiler the time that a forward takes before happening plugin side.

__

By the way, does Sawce still visits the forums?
__________________
joaquimandrade is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-20-2009 , 03:57   Re: amxmodx profiler
Reply With Quote #43

Quote:
Last Activity: Yesterday 12:03
It seems.
Arkshine is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-20-2009 , 04:00   Re: amxmodx profiler
Reply With Quote #44

Quote:
Originally Posted by arkshine View Post
It seems.
He should be tired of working for free here.
__________________
joaquimandrade is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 04-20-2009 , 04:00   Re: amxmodx profiler
Reply With Quote #45

Quote:
Originally Posted by sawce's profile statistics
  • Last Activity: Yesterday 07:03 AM
  • Join Date: 08-10-04
  • Referrals: 5
__________________

Community / No support through PM
danielkza is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-20-2009 , 04:02   Re: amxmodx profiler
Reply With Quote #46

By the way, arkshine:

[IMG]http://img4.**************/img4/567/arkd.png[/IMG]
__________________
joaquimandrade is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 04-20-2009 , 19:53   Re: amxmodx profiler
Reply With Quote #47

Quote:
Originally Posted by joaquimandrade View Post
While caching variables is faster no matter what, the comparison is not fair.
You're right, but at least I made Emp` happy.

Any ideas about the max time per call increasing proportionally with the number of total calls?

I'm too much of a C++ noob to inspect the source, and I'm not very knowledgeable on the topic.
__________________
stupok is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-20-2009 , 20:01   Re: amxmodx profiler
Reply With Quote #48

Quote:
Originally Posted by stupok View Post
You're right, but at least I made Emp` happy.

Any ideas about the max time per call increasing proportionally with the number of total calls?

I'm too much of a C++ noob to inspect the source, and I'm not very knowledgeable on the topic.
You got that profile results with windows or linux?
__________________
joaquimandrade is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 04-20-2009 , 20:31   Re: amxmodx profiler
Reply With Quote #49

windows
__________________
stupok is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-14-2009 , 03:44   Re: amxmodx profiler
Reply With Quote #50

Could someone do a profile for:

Code:
random(var);
vs
Code:
random_num(0,var-1);
and
Code:
new var = 10;
vs
Code:
static var;
var = 10;
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`
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 17:00.


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