Raised This Month: $ Target: $400
 0% 

benchmark/profiling entity_range() and get_distance_f() with cached origins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 04-02-2009 , 15:37   benchmark/profiling entity_range() and get_distance_f() with cached origins
Reply With Quote #1

can someone pls benchmark this code? i cant cuz my cs is crashing with both profiling binarys

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

#define TESTS 100000

public plugin_init( )
{
    
register_clcmd"say /test1""cmdTest1" );
    
register_clcmd"say /test2""cmdTest2" );
}

public 
cmdTest1plr )
{
    new 
Float:distance;
    
    for( new 
iTESTSi++ )
    {
        
distance entity_rangeplr);
    }
}

public 
cmdTest2plr )
{
    new 
Float:distance;

    new 
Float:origin1[3], Float:origin2[3];
    
pevplrpev_originorigin1 );
    
pev2pev_originorigin2 );
    
    for( new 
iTESTSi++ )
    {
        
distance get_distance_forigin1origin2 );
    }

__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-02-2009 , 16:00   Re: benchmark/profiling entity_range() and get_distance_f() with cached origins
Reply With Quote #2

PHP Code:
public cmdTest1plr )
{
    new 
entmaxents global_getglb_maxEntities )
    for(
ent get_maxplayers()+1ent<maxentsent++)
    {
        if( 
pev_valid(ent) )
        {
            break
        }
    }

    new 
Float:origin1[3], Float:origin2[3];
    
pevplrpev_originorigin1 );
    
peventpev_originorigin2 );

    for( new 
iTESTSi++ )
    {
        
entity_rangeplrent );
        
get_distance_forigin1origin2 )
    }

Code:
date: Thu Apr 02 21:58:59 2009 map: de_dust2
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                   register_clcmd |          1 | 0.000004 / 0.000004 / 0.000004
   n |                       global_get |          1 | 0.000001 / 0.000001 / 0.000001
   n |                   get_maxplayers |          1 | 0.000000 / 0.000000 / 0.000000
   n |                        pev_valid |          1 | 0.000001 / 0.000001 / 0.000001
   n |                              pev |          2 | 0.000002 / 0.000000 / 0.000001
   n |                     entity_range |     100000 | 0.022782 / 0.000000 / 0.000086
   n |                   get_distance_f |     100000 | 0.021839 / 0.000000 / 0.000060
   p |                         cmdTest1 |          1 | 0.038927 / 0.038927 / 0.038927
   p |                      plugin_init |          1 | 0.000001 / 0.000001 / 0.000001
0 natives, 0 public callbacks, 2 function calls were not executed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 04-02-2009 , 16:56   Re: benchmark/profiling entity_range() and get_distance_f() with cached origins
Reply With Quote #3

thx
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
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 02:17.


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