The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions
pair_list_perf_test.c File Reference

Performance tests for lists of fr_pair_t. More...

#include <freeradius-devel/util/acutest.h>
#include <freeradius-devel/util/dict_test.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/rand.h>
+ Include dependency graph for pair_list_perf_test.c:

Go to the source code of this file.

Macros

#define all_repetition_tests(_func)
 
#define all_test_funcs(_func)
 
#define repetition_tests(_func, _perc)
 
#define test_func(_func, _count, _perc, _source_vps)
 
#define test_funcs(_func, _perc)
 
#define USE_CONSTRUCTOR
 The 'TEST_INIT' macro provided by 'acutest.h' allows registering a function to be called before call the unit tests. More...
 

Functions

 all_test_funcs (fr_pair_append)
 
static void do_test_find_nth (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[])
 
static void do_test_fr_pair_append (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[])
 
static void do_test_fr_pair_find_by_da_idx (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[])
 
static void do_test_fr_pair_list_free (unsigned int len, unsigned int perc, unsigned int reps, fr_pair_t *source_vps[])
 
static void pair_list_perf_init (void)
 

Detailed Description

Performance tests for lists of fr_pair_t.

Author
Nick Porter nick..nosp@m.port.nosp@m.er@ne.nosp@m.twor.nosp@m.kradi.nosp@m.us.c.nosp@m.om

Definition in file pair_list_perf_test.c.

Macro Definition Documentation

◆ all_repetition_tests

#define all_repetition_tests (   _func)
Value:
repetition_tests(_func, 0) \
repetition_tests(_func, 25) \
repetition_tests(_func, 50) \
repetition_tests(_func, 75) \
repetition_tests(_func, 100)
#define repetition_tests(_func, _perc)

◆ all_test_funcs

#define all_test_funcs (   _func)
Value:
test_funcs(_func, 0) \
test_funcs(_func, 25) \
test_funcs(_func, 50) \
test_funcs(_func, 75) \
test_funcs(_func, 100)
#define test_funcs(_func, _perc)

Definition at line 498 of file pair_list_perf_test.c.

◆ repetition_tests

#define repetition_tests (   _func,
  _perc 
)
Value:
{ #_func "_20_" #_perc, test_ ## _func ## _20_ ## _perc},\
{ #_func "_40_" #_perc, test_ ## _func ## _40_ ## _perc},\
{ #_func "_60_" #_perc, test_ ## _func ## _60_ ## _perc},\
{ #_func "_80_" #_perc, test_ ## _func ## _80_ ## _perc},\
{ #_func "_100_" #_perc, test_ ## _func ## _100_ ## _perc},\

◆ test_func

#define test_func (   _func,
  _count,
  _perc,
  _source_vps 
)
Value:
static void test_ ## _func ## _ ## _count ## _ ## _perc(void)\
{\
do_test_ ## _func(_count, _perc, 10000, _source_vps);\
}

Definition at line 485 of file pair_list_perf_test.c.

◆ test_funcs

#define test_funcs (   _func,
  _perc 
)
Value:
test_func(_func, 20, _perc, source_vps_ ## _perc) \
test_func(_func, 40, _perc, source_vps_ ## _perc) \
test_func(_func, 60, _perc, source_vps_ ## _perc) \
test_func(_func, 80, _perc, source_vps_ ## _perc) \
test_func(_func, 100, _perc, source_vps_ ## _perc)
#define test_func(_func, _count, _perc, _source_vps)

Definition at line 491 of file pair_list_perf_test.c.

◆ USE_CONSTRUCTOR

#define USE_CONSTRUCTOR

The 'TEST_INIT' macro provided by 'acutest.h' allows registering a function to be called before call the unit tests.

Therefore, It calls the function ALL THE TIME causing an overhead. That is why we are initializing pair_list_perf_init() by "__attribute__((constructor));" reducing the test execution by 50% of the time.

Definition at line 31 of file pair_list_perf_test.c.

Function Documentation

◆ all_test_funcs()

all_test_funcs ( fr_pair_append  )

Definition at line 505 of file pair_list_perf_test.c.

+ Here is the call graph for this function:

◆ do_test_find_nth()

static void do_test_find_nth ( unsigned int  len,
unsigned int  perc,
unsigned int  reps,
fr_pair_t source_vps[] 
)
static

Definition at line 402 of file pair_list_perf_test.c.

+ Here is the call graph for this function:

◆ do_test_fr_pair_append()

static void do_test_fr_pair_append ( unsigned int  len,
unsigned int  perc,
unsigned int  reps,
fr_pair_t source_vps[] 
)
static

Definition at line 314 of file pair_list_perf_test.c.

+ Here is the call graph for this function:

◆ do_test_fr_pair_find_by_da_idx()

static void do_test_fr_pair_find_by_da_idx ( unsigned int  len,
unsigned int  perc,
unsigned int  reps,
fr_pair_t source_vps[] 
)
static

Definition at line 356 of file pair_list_perf_test.c.

+ Here is the call graph for this function:

◆ do_test_fr_pair_list_free()

static void do_test_fr_pair_list_free ( unsigned int  len,
unsigned int  perc,
unsigned int  reps,
fr_pair_t source_vps[] 
)
static

Definition at line 451 of file pair_list_perf_test.c.

+ Here is the call graph for this function:

◆ pair_list_perf_init()

void pair_list_perf_init ( void  )
static

Definition at line 37 of file pair_list_perf_test.c.