I don't have them anymore. But what I did is just basically checking difference between original release which contains profiler and another release which doesn't contain it. Nothing specifically hard, just takes some time.
Anyway, when you think about it, except the natives to profile a chunk of code, this is not really worth, because you know when a code is going to be called often so having a table with some times is not going to help much. Also this is not really accurate. You can find some useful answers here: https://bugs.alliedmods.net/show_bug.cgi?id=6096
I think that most of the people who want to use the profiler want it to compare natives between each others basically because there is redundancy in amxmodx.
Imo fakemeta pev are a bit redundant compared to engine entity_g/set_*.
And apparently, they are a bit slower than engine version.
Also, Fakemeta util is stupid.
Sadly what is done is done but the fact that people still want a profiler or debate about transforming plugins to fakemeta only is pretty much the consequence of a wrong scope in older amxmodx dev team.
I think that most of the people who want to use the profiler want it to compare natives between each others basically because there is redundancy in amxmodx.
Imo fakemeta pev are a bit redundant compared to engine entity_g/set_*.
And apparently, they are a bit slower than engine version.
Also, Fakemeta util is stupid.
Sadly what is done is done but the fact that people still want a profiler or debate about transforming plugins to fakemeta only is pretty much the consequence of a wrong scope in older amxmodx dev team.
Even if fakemeta pev_ functions are a bit slower I prefer them because it's easier to read them and to use, but this is only my opinion and the difference is trivial. Peoples should use what is easier to use for them.
I was quite sure that there was actually added functionality provided by fakemeta but then again, I came in during the anti-engine movement so I could be wrong.
I do not understand how can I know which 44 calls are not executed?
I don't know a whole lot about the profiler, but however as stated in some posts above your better off having an experienced user just check your code for use of the correct solutions in the correct contexts.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
Ever wanted to use this sawceful tool without having any crashes ?
The following binaries are for you !
- Merged changes on the latest AMXX version (1.8.2-dev, rev24)
- Fixed crash when the natives are used
- Fixed crash when csx module is loaded
Thanks to Joropito for his patience by supporting my boring c/c++ question.
I've tested under windows (7) and linux (compiled with gcc4.5), and it seems to work fine.
Feedback are welcomed, especially using the natives.
- Enjoy.
I have installed it to a Windows standalone server to test the plugins before I install them to the linux hlds. The reason of this is we have 1 core at the server machine that runs currently at 90-95%.
But I don't know how to use it or where to search for the table that many of you posted with the results.
The linux hlds goes laggy if it hits ~500mb memory usage so somehow I want to decrease the memory usage. I have asked the "hosting" about why don't they just add a 2nd cpu core to our server but they are on a holiday trip atm... :/
I have a "basic" scripting knowledge, so I think I can understand if you tell me somehing scripting stuff.
I did a benchmark between a static array and a dynamic array and I came here to share the results. It is just to see how big the difference could be. And as the same as tries and static arrays, you should use dynamic arrays, when it makes sense to it, i.e., they fit the well the problem solving.
Code:
date: Thu Jan 28 03:48:10 2016 map: de_dust2
type | name | calls | time / min / max
-------------------------------------------------------------------
n | register_plugin | 1 | 0.000009 / 0.000009 / 0.000009
n | register_srvcmd | 1 | 0.000069 / 0.000069 / 0.000069
n | ArrayCreate | 1 | 0.000002 / 0.000002 / 0.000002
n | ArrayPushCell | 32 | 0.000002 / 0.000000 / 0.000000
n | server_cmd | 1 | 0.000006 / 0.000006 / 0.000006
n | ArrayGetCell | 32000000 | 2.712061 / 0.000000 / 0.009609
p | cmd_go | 1 | 0.220705 / 0.220705 / 0.220705
p | plugin_init | 1 | 0.000005 / 0.000005 / 0.000005
f | UseStaticArray | 1000000 | 0.801795 / 0.000000 / 0.004913
f | UseDynamicArray | 1000000 | 28.758015 / 0.000016 / 0.034018
0 natives, 0 public callbacks, 2 function calls were not executed.
This was the source code used:
Spoiler
Code:
#include <amxmodx>#include <amxmisc>#define PLUGIN "Arrays Benchmark"#define AUTHOR "stupok/addons zz"#define VERSION "1.0"new g_array_size =32new g_current_element
new Array: g_DynamicArray
new g_StaticArray[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}public plugin_init(){register_plugin(PLUGIN, VERSION, AUTHOR)register_srvcmd("go", "cmd_go")
g_DynamicArray = ArrayCreate(1)for(new index =0; index < g_array_size; index++){
ArrayPushCell( g_DynamicArray, g_StaticArray[ index ])}}public cmd_go(){new index
for( index =0; index < 1000000; index++){
UseStaticArray()}for( index =0; index < 1000000; index++){
UseDynamicArray()}server_cmd("quit")}
UseStaticArray(){static index
for( index =0; index < g_array_size; index++){
g_current_element = g_StaticArray[ index ]
g_current_element++}}
UseDynamicArray(){static index
for( index =0; index < g_array_size; index++){
g_current_element = ArrayGetCell( g_DynamicArray, index )
g_current_element++}}
is_user_connect
Looks like is better use 'is_user_connect' instead of cache it's value, because the diference seen insignificant.
Code:
date: Fri Jan 29 01:58:47 2016 map: de_dust2
type | name | calls | time / min / max
-------------------------------------------------------------------
n | register_plugin | 1 | 0.000011 / 0.000011 / 0.000011
n | register_srvcmd | 1 | 0.000114 / 0.000114 / 0.000114
n | server_cmd | 1 | 0.000008 / 0.000008 / 0.000008
n | is_user_connected | 32000000 | 2.580960 / 0.000000 / 0.014820
p | cmd_go | 1 | 0.266977 / 0.266977 / 0.266977
p | plugin_init | 1 | 0.000003 / 0.000003 / 0.000003
f | use_user_connected | 1000000 | 5.494115 / 0.000000 / 0.059881
f | use_cached_value | 1000000 | 1.743552 / 0.000001 / 0.021680
0 natives, 0 public callbacks, 2 function calls were not executed.
This was the source code used:
Spoiler
Code:
#include <amxmodx>#include <amxmisc>#define PLUGIN "Arrays Benchmark"#define AUTHOR "stupok/addons zz"#define VERSION "1.0"new g_array_size =32new g_unused_value
new g_StaticArray[]={1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0}public plugin_init(){register_plugin(PLUGIN, VERSION, AUTHOR)register_srvcmd("go", "cmd_go")}public cmd_go(){new index
g_unused_value =0for( index =0; index < 1000000; index++){
use_user_connected()}
g_unused_value =0for( index =0; index < 1000000; index++){
use_cached_value()}server_cmd("quit")}
use_user_connected(){static index
for( index =1; index <= g_array_size; index++){if(is_user_connected( index )){
g_unused_value++}}}
use_cached_value(){static index
for( index =0; index < g_array_size; index++){if( g_StaticArray[ index ]){
g_unused_value++}}}
cs_get_user_team
'cs_get_user_team' vs cached value benchmark.
Code:
date: Fri Jan 29 03:21:04 2016 map: de_dust2
type | name | calls | time / min / max
-------------------------------------------------------------------
n | register_plugin | 1 | 0.000009 / 0.000009 / 0.000009
n | register_srvcmd | 1 | 0.000099 / 0.000099 / 0.000099
n | get_players | 1 | 0.000003 / 0.000003 / 0.000003
n | cs_get_user_team | 31000031 | 7.618567 / 0.000000 / 0.023226
n | server_cmd | 1 | 0.000006 / 0.000006 / 0.000006
p | cmd_go | 1 | 0.208685 / 0.208685 / 0.208685
p | plugin_init | 1 | 0.000002 / 0.000002 / 0.000002
f | use_get_user_team | 1000000 | 8.162432 / 0.000000 / 0.016805
f | use_cached_value | 1000000 | 1.997416 / 0.000002 / 0.003139
0 natives, 0 public callbacks, 2 function calls were not executed.
This was the source code used:
Spoiler
Code:
#include <amxmodx>#include <amxmisc>#include <cstrike>#define PLUGIN "Arrays Benchmark"#define AUTHOR "stupok/addons zz"#define VERSION "1.0"new g_cached_value[33]new g_unuseful_value1
new g_unuseful_value2
new g_unuseful_value3
new g_unuseful_value4
new g_players_count
new g_players[32]public plugin_init(){register_plugin(PLUGIN, VERSION, AUTHOR)register_srvcmd("go", "cmd_go")}public cmd_go(){new index
get_players( g_players, g_players_count )for(new index =0; index < g_players_count; index++){
g_cached_value[ g_players[ index ]]= _:cs_get_user_team( g_players[ index ])}
g_unuseful_value1 =0
g_unuseful_value2 =0
g_unuseful_value3 =0
g_unuseful_value4 =0for( index =0; index < 1000000; index++){
use_get_user_team()}
g_unuseful_value1 =0
g_unuseful_value2 =0
g_unuseful_value3 =0
g_unuseful_value4 =0for( index =0; index < 1000000; index++){
use_cached_value()}server_cmd("quit")}
use_get_user_team(){static index
for( index =0; index < g_players_count; index++){switch( cs_get_user_team( g_players[ index ])){case CS_TEAM_CT : g_unuseful_value1++case CS_TEAM_T : g_unuseful_value2++case CS_TEAM_SPECTATOR : g_unuseful_value3++default: g_unuseful_value4++}}}
use_cached_value(){static index
for( index =0; index < g_players_count; index++){switch( g_cached_value[ g_players[ index ]]){case CS_TEAM_CT : g_unuseful_value1++case CS_TEAM_T : g_unuseful_value2++case CS_TEAM_SPECTATOR : g_unuseful_value3++default: g_unuseful_value4++}}}
is_user_alive
'is_user_alive' vs cached value benchmark.
Code:
date: Fri Jan 29 03:34:38 2016 map: de_dust2
type | name | calls | time / min / max
-------------------------------------------------------------------
n | register_plugin | 1 | 0.000010 / 0.000010 / 0.000010
n | register_srvcmd | 1 | 0.000099 / 0.000099 / 0.000099
n | get_players | 1 | 0.000005 / 0.000005 / 0.000005
n | is_user_alive | 31000031 | 2.379797 / 0.000000 / 0.002604
n | server_cmd | 1 | 0.000007 / 0.000007 / 0.000007
p | cmd_go | 1 | 0.199224 / 0.199224 / 0.199224
p | plugin_init | 1 | 0.000003 / 0.000003 / 0.000003
f | use_user_alive | 1000000 | 4.456642 / 0.000000 / 0.009792
f | use_cached_value | 1000000 | 1.314150 / 0.000001 / 0.002849
0 natives, 0 public callbacks, 2 function calls were not executed.
This was the source code used:
Spoiler
Code:
#include <amxmodx>#include <amxmisc>#include <cstrike>#define PLUGIN "Arrays Benchmark"#define AUTHOR "stupok/addons zz"#define VERSION "1.0"new g_cached_value[33]new g_unuseful_value1
new g_players_count
new g_players[32]public plugin_init(){register_plugin(PLUGIN, VERSION, AUTHOR)register_srvcmd("go", "cmd_go")}public cmd_go(){new index
get_players( g_players, g_players_count )for(new index =0; index < g_players_count; index++){
g_cached_value[ g_players[ index ]]=is_user_alive( g_players[ index ])}
g_unuseful_value1 =0for( index =0; index < 1000000; index++){
use_user_alive()}
g_unuseful_value1 =0for( index =0; index < 1000000; index++){
use_cached_value()}server_cmd("quit")}
use_user_alive(){static index
for( index =0; index < g_players_count; index++){if(is_user_alive( g_players[ index ])){
g_unuseful_value1++}}}
use_cached_value(){static index
for( index =0; index < g_players_count; index++){if( g_cached_value[ g_players[ index ]]){
g_unuseful_value1++}}}