Blender  V3.3
Macros | Functions
BLI_ghash_performance_test.cc File Reference
#include "BLI_ressource_strings.h"
#include "testing/testing.h"
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_rand.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "PIL_time_utildefines.h"

Go to the source code of this file.

Macros

#define GHASH_INTERNAL_API
 
#define TESTCASE_SIZE_SMALL   17
 
#define PRINTF_GHASH_STATS(_gh)
 

Functions

static void str_ghash_tests (GHash *ghash, const char *id)
 
 TEST (ghash, TextGHash)
 
 TEST (ghash, TextMurmur2a)
 
static void int_ghash_tests (GHash *ghash, const char *id, const unsigned int count)
 
 TEST (ghash, IntGHash12000)
 
 TEST (ghash, IntMurmur2a12000)
 
static void randint_ghash_tests (GHash *ghash, const char *id, const unsigned int count)
 
 TEST (ghash, IntRandGHash12000)
 
 TEST (ghash, IntRandMurmur2a12000)
 
static unsigned int ghashutil_tests_nohash_p (const void *p)
 
static bool ghashutil_tests_cmp_p (const void *a, const void *b)
 
 TEST (ghash, Int4NoHash12000)
 
static void int4_ghash_tests (GHash *ghash, const char *id, const unsigned int count)
 
 TEST (ghash, Int4GHash2000)
 
 TEST (ghash, Int4Murmur2a2000)
 
 TEST (ghash, Int2NoHash12000)
 
static void multi_small_ghash_tests_one (GHash *ghash, RNG *rng, const unsigned int count)
 
static void multi_small_ghash_tests (GHash *ghash, const char *id, const unsigned int count)
 
 TEST (ghash, MultiRandIntGHash2000)
 
 TEST (ghash, MultiRandIntGHash200000)
 
 TEST (ghash, MultiRandIntMurmur2a2000)
 
 TEST (ghash, MultiRandIntMurmur2a200000)
 

Macro Definition Documentation

◆ GHASH_INTERNAL_API

#define GHASH_INTERNAL_API

Definition at line 6 of file BLI_ghash_performance_test.cc.

◆ PRINTF_GHASH_STATS

#define PRINTF_GHASH_STATS (   _gh)
Value:
{ \
double q, lf, var, pempty, poverloaded; \
int bigb; \
q = BLI_ghash_calc_quality_ex((_gh), &lf, &var, &pempty, &poverloaded, &bigb); \
printf( \
"GHash stats (%u entries):\n\t" \
"Quality (the lower the better): %f\n\tVariance (the lower the better): %f\n\tLoad: " \
"%f\n\t" \
"Empty buckets: %.2f%%\n\tOverloaded buckets: %.2f%% (biggest bucket: %d)\n", \
BLI_ghash_len(_gh), \
q, \
var, \
lf, \
pempty * 100.0, \
poverloaded * 100.0, \
bigb); \
} \
void(0)
double BLI_ghash_calc_quality_ex(GHash *gh, double *r_load, double *r_variance, double *r_prop_empty_buckets, double *r_prop_overloaded_buckets, int *r_biggest_bucket)
Definition: BLI_ghash.c:1097
unsigned int BLI_ghash_len(const GHash *gh) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:705

Definition at line 33 of file BLI_ghash_performance_test.cc.

◆ TESTCASE_SIZE_SMALL

#define TESTCASE_SIZE_SMALL   17

Definition at line 31 of file BLI_ghash_performance_test.cc.

Function Documentation

◆ ghashutil_tests_cmp_p()

static bool ghashutil_tests_cmp_p ( const void a,
const void b 
)
static

Definition at line 355 of file BLI_ghash_performance_test.cc.

References Freestyle::a, and usdtokens::b().

Referenced by TEST().

◆ ghashutil_tests_nohash_p()

static unsigned int ghashutil_tests_nohash_p ( const void p)
static

Definition at line 350 of file BLI_ghash_performance_test.cc.

References POINTER_AS_UINT.

Referenced by TEST().

◆ int4_ghash_tests()

static void int4_ghash_tests ( GHash ghash,
const char *  id,
const unsigned int  count 
)
static

◆ int_ghash_tests()

static void int_ghash_tests ( GHash ghash,
const char *  id,
const unsigned int  count 
)
static

◆ multi_small_ghash_tests()

static void multi_small_ghash_tests ( GHash ghash,
const char *  id,
const unsigned int  count 
)
static

◆ multi_small_ghash_tests_one()

static void multi_small_ghash_tests_one ( GHash ghash,
RNG rng,
const unsigned int  count 
)
static

◆ randint_ghash_tests()

static void randint_ghash_tests ( GHash ghash,
const char *  id,
const unsigned int  count 
)
static

◆ str_ghash_tests()

static void str_ghash_tests ( GHash ghash,
const char *  id 
)
static

◆ TEST() [1/14]

TEST ( ghash  ,
Int2NoHash12000   
)

◆ TEST() [2/14]

TEST ( ghash  ,
Int4GHash2000   
)

◆ TEST() [3/14]

TEST ( ghash  ,
Int4Murmur2a2000   
)

◆ TEST() [4/14]

TEST ( ghash  ,
Int4NoHash12000   
)

◆ TEST() [5/14]

TEST ( ghash  ,
IntGHash12000   
)

◆ TEST() [6/14]

TEST ( ghash  ,
IntMurmur2a12000   
)

◆ TEST() [7/14]

TEST ( ghash  ,
IntRandGHash12000   
)

◆ TEST() [8/14]

TEST ( ghash  ,
IntRandMurmur2a12000   
)

◆ TEST() [9/14]

TEST ( ghash  ,
MultiRandIntGHash2000   
)

◆ TEST() [10/14]

TEST ( ghash  ,
MultiRandIntGHash200000   
)

◆ TEST() [11/14]

TEST ( ghash  ,
MultiRandIntMurmur2a2000   
)

◆ TEST() [12/14]

TEST ( ghash  ,
MultiRandIntMurmur2a200000   
)

◆ TEST() [13/14]

TEST ( ghash  ,
TextGHash   
)

◆ TEST() [14/14]

TEST ( ghash  ,
TextMurmur2a   
)