Blender V4.3
BLI_map_performance_test.cc File Reference
#include "BLI_ressource_strings.h"
#include "testing/testing.h"
#include "MEM_guardedalloc.h"
#include "BLI_fileops.h"
#include "BLI_ghash.h"
#include "BLI_map.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_rand.h"
#include "BLI_string.h"
#include "BLI_timeit.hh"
#include "BLI_utildefines.h"

Go to the source code of this file.

Macros

#define GHASH_INTERNAL_API
 

Functions

static void print_ghash_stats (GHash *gh)
 
static char * read_text_corpus ()
 
static void str_ghash_tests (GHash *ghash, const char *id)
 
template<typename MapType >
static void str_map_tests (MapType &map, const char *id)
 
 TEST (ghash, TextGHash)
 
 TEST (ghash, TextMurmur2a)
 
 TEST (ghash, TextMap)
 
static void int_ghash_tests (GHash *ghash, const char *id, const uint count)
 
template<typename MapType >
static void int_map_tests (MapType &map, const char *id, const uint count)
 
 TEST (ghash, IntGHash12000)
 
 TEST (ghash, IntMurmur2a12000)
 
 TEST (ghash, IntMap12000)
 
static void randint_ghash_tests (GHash *ghash, const char *id, const uint count)
 
template<typename MapType >
static void randint_map_tests (MapType &map, const char *id, const uint count)
 
 TEST (ghash, IntRandGHash12000)
 
 TEST (ghash, IntRandMurmur2a12000)
 
 TEST (ghash, IntRandMap12000)
 
static uint ghashutil_tests_nohash_p (const void *p)
 
static bool ghashutil_tests_cmp_p (const void *a, const void *b)
 
 TEST (ghash, IntRandNoHash12000)
 
static void int4_ghash_tests (GHash *ghash, const char *id, const uint count)
 
template<typename MapType >
static void int4_map_tests (MapType &map, const char *id, const uint count)
 
 TEST (ghash, Int4GHash2000)
 
 TEST (ghash, Int4Murmur2a2000)
 
 TEST (ghash, Int4Map2000)
 
static void multi_small_ghash_tests_one (GHash *ghash, RNG *rng, const uint count)
 
static void multi_small_ghash_tests (GHash *ghash, const char *id, const uint count)
 
 TEST (ghash, MultiRandIntGHash2000)
 
 TEST (ghash, MultiRandIntGHash200000)
 
 TEST (ghash, MultiRandIntMurmur2a2000)
 
 TEST (ghash, MultiRandIntMurmur2a200000)
 

Variables

static constexpr bool USE_RESERVE_COUNT = false
 
static constexpr size_t TESTCASE_SIZE_SMALL = 17
 

Macro Definition Documentation

◆ GHASH_INTERNAL_API

#define GHASH_INTERNAL_API

Definition at line 8 of file BLI_map_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 513 of file BLI_map_performance_test.cc.

References b.

Referenced by TEST().

◆ ghashutil_tests_nohash_p()

static uint ghashutil_tests_nohash_p ( const void * p)
static

Definition at line 508 of file BLI_map_performance_test.cc.

References POINTER_AS_UINT.

Referenced by TEST().

◆ int4_ghash_tests()

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

◆ int4_map_tests()

template<typename MapType >
static void int4_map_tests ( MapType & map,
const char * id,
const uint count )
static

◆ int_ghash_tests()

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

◆ int_map_tests()

template<typename MapType >
static void int_map_tests ( MapType & map,
const char * id,
const uint count )
static

Definition at line 294 of file BLI_map_performance_test.cc.

References count, EXPECT_EQ(), printf, SCOPED_TIMER, USE_RESERVE_COUNT, and v.

Referenced by TEST().

◆ multi_small_ghash_tests()

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

◆ multi_small_ghash_tests_one()

static void multi_small_ghash_tests_one ( GHash * ghash,
RNG * rng,
const uint count )
static

◆ print_ghash_stats()

static void print_ghash_stats ( GHash * gh)
static

◆ randint_ghash_tests()

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

◆ randint_map_tests()

template<typename MapType >
static void randint_map_tests ( MapType & map,
const char * id,
const uint count )
static

◆ read_text_corpus()

static char * read_text_corpus ( )
static

Definition at line 61 of file BLI_map_performance_test.cc.

References BLI_file_read_text_as_mem(), BLI_strdup(), data, and words10k.

Referenced by str_ghash_tests(), and str_map_tests().

◆ str_ghash_tests()

◆ str_map_tests()

template<typename MapType >
static void str_map_tests ( MapType & map,
const char * id )
static

◆ TEST() [1/17]

TEST ( ghash ,
Int4GHash2000  )

◆ TEST() [2/17]

TEST ( ghash ,
Int4Map2000  )

Definition at line 657 of file BLI_map_performance_test.cc.

References int4_map_tests().

◆ TEST() [3/17]

TEST ( ghash ,
Int4Murmur2a2000  )

◆ TEST() [4/17]

TEST ( ghash ,
IntGHash12000  )

◆ TEST() [5/17]

TEST ( ghash ,
IntMap12000  )

Definition at line 367 of file BLI_map_performance_test.cc.

References int_map_tests().

◆ TEST() [6/17]

TEST ( ghash ,
IntMurmur2a12000  )

◆ TEST() [7/17]

TEST ( ghash ,
IntRandGHash12000  )

◆ TEST() [8/17]

TEST ( ghash ,
IntRandMap12000  )

Definition at line 494 of file BLI_map_performance_test.cc.

References randint_map_tests().

◆ TEST() [9/17]

TEST ( ghash ,
IntRandMurmur2a12000  )

◆ TEST() [10/17]

TEST ( ghash ,
IntRandNoHash12000  )

◆ TEST() [11/17]

TEST ( ghash ,
MultiRandIntGHash2000  )

◆ TEST() [12/17]

TEST ( ghash ,
MultiRandIntGHash200000  )

◆ TEST() [13/17]

TEST ( ghash ,
MultiRandIntMurmur2a2000  )

◆ TEST() [14/17]

TEST ( ghash ,
MultiRandIntMurmur2a200000  )

◆ TEST() [15/17]

TEST ( ghash ,
TextGHash  )

◆ TEST() [16/17]

TEST ( ghash ,
TextMap  )

Definition at line 240 of file BLI_map_performance_test.cc.

References str_map_tests().

◆ TEST() [17/17]

TEST ( ghash ,
TextMurmur2a  )

Variable Documentation

◆ TESTCASE_SIZE_SMALL

size_t TESTCASE_SIZE_SMALL = 17
staticconstexpr

Definition at line 38 of file BLI_map_performance_test.cc.

Referenced by multi_small_ghash_tests().

◆ USE_RESERVE_COUNT