Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Macros | Functions | Variables
test_cow_darray_perf01.cpp File Reference
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <random>
#include <vector>
#include <jau/test/catch2_ext.hpp>
#include "test_datatype01.hpp"
#include <jau/basic_types.hpp>
#include <jau/basic_algos.hpp>
#include <jau/darray.hpp>
#include <jau/cow_darray.hpp>
#include <jau/cow_vector.hpp>
#include <jau/counting_allocator.hpp>
#include <jau/callocator.hpp>
#include <jau/counting_callocator.hpp>
Include dependency graph for test_cow_darray_perf01.cpp:

Go to the source code of this file.

Macros

#define RUN_INDEXED_BENCHMARK   0
 
#define RUN_RESERVE_BENCHMARK   0
 

Functions

template<class T , typename Size_type >
static bool benchmark_fillseq_list_idx (const std::string &title_pre, const std::string &type_id, const bool do_rserv)
 
template<class T , typename Size_type >
static bool benchmark_fillseq_list_itr (const std::string &title_pre, const std::string &type_id, const bool do_rserv)
 
template<class T , typename Size_type >
static bool benchmark_fillunique_find_idx (const std::string &title_pre, const std::string &type_id, const bool do_rserv)
 
template<class T , typename Size_type >
static bool benchmark_fillunique_find_itr (const std::string &title_pre, const std::string &type_id, const bool do_rserv)
 
template<class value_type >
static bool equal_comparator (const value_type &a, const value_type &b)
 
template<class T , typename Size_type >
const DataType01findDataSet01_idx (T &data, DataType01 const &elem) noexcept
 
template<class T , typename Size_type >
const DataType01findDataSet01_itr (T &data, DataType01 const &elem, std::enable_if_t< !is_cow_type< T >::value, bool >=true) noexcept
 
template<class T , typename Size_type >
const DataType01findDataSet01_itr (T &data, DataType01 const &elem, std::enable_if_t< is_cow_type< T >::value, bool >=true) noexcept
 
template<class T , typename Size_type >
static bool footprint_fillseq_list_itr (const std::string &type_id, const bool do_rserv)
 
template<class Cont >
static void print_container_info (const std::string &type_id, const Cont &c, std::enable_if_t< !jau::is_darray_type< Cont >::value, bool >=true)
 
template<class Cont >
static void print_container_info (const std::string &type_id, const Cont &c, std::enable_if_t< jau::is_darray_type< Cont >::value, bool >=true)
 
template<class T >
static void print_mem (const std::string &pre, const T &data)
 
template<class T , typename Size_type >
static int test_00_list_idx (T &data)
 
template<class T >
static int test_00_list_itr (T &data, std::enable_if_t< !is_cow_type< T >::value, bool >=true)
 
template<class T >
static int test_00_list_itr (T &data, std::enable_if_t< is_cow_type< T >::value, bool >=true)
 
template<class T , typename Size_type >
static void test_00_seq_fill (T &data, const Size_type size)
 
template<class T , typename Size_type >
static void test_00_seq_fill_unique_idx (T &data, const Size_type size)
 
template<class T , typename Size_type >
static void test_00_seq_fill_unique_itr (T &data, const Size_type size, std::enable_if_t< !is_cow_type< T >::value, bool >=true)
 
template<class T , typename Size_type >
static void test_00_seq_fill_unique_itr (T &data, const Size_type size, std::enable_if_t< is_cow_type< T >::value, bool >=true)
 
template<class T , typename Size_type >
static void test_00_seq_find_idx (T &data)
 
template<class T , typename Size_type >
static void test_00_seq_find_itr (T &data)
 
template<class T , typename Size_type >
static bool test_01_seq_fill_list_footprint (const std::string &type_id, const Size_type size0, const Size_type reserve0, const bool do_print_mem)
 
template<class T , typename Size_type >
static bool test_01_seq_fill_list_idx (const std::string &type_id, const Size_type size0, const Size_type reserve0)
 
template<class T , typename Size_type >
static bool test_01_seq_fill_list_itr (const std::string &type_id, const Size_type size0, const Size_type reserve0)
 
template<class T , typename Size_type >
static bool test_02_seq_fillunique_find_idx (const std::string &type_id, const Size_type size0, const Size_type reserve0)
 
template<class T , typename Size_type >
static bool test_02_seq_fillunique_find_itr (const std::string &type_id, const Size_type size0, const Size_type reserve0)
 
 TEST_CASE ("Memory Footprint 01 - Fill Sequential and List", "[datatype][footprint]")
 
 TEST_CASE ("Perf Test 01 - Fill Sequential and List, empty and reserve", "[datatype][sequential]")
 
 TEST_CASE ("Perf Test 02 - Fill Unique and List, empty and reserve", "[datatype][unique]")
 

Variables

static Addr48Bit start_addr (start_addr_b)
 
static uint8_t start_addr_b [] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 

Macro Definition Documentation

◆ RUN_RESERVE_BENCHMARK

#define RUN_RESERVE_BENCHMARK   0

Definition at line 48 of file test_cow_darray_perf01.cpp.

◆ RUN_INDEXED_BENCHMARK

#define RUN_INDEXED_BENCHMARK   0

Definition at line 49 of file test_cow_darray_perf01.cpp.

Function Documentation

◆ print_container_info() [1/2]

template<class Cont >
static void print_container_info ( const std::string &  type_id,
const Cont &  c,
std::enable_if_t< jau::is_darray_type< Cont >::value, bool >  = true 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 55 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

◆ print_container_info() [2/2]

template<class Cont >
static void print_container_info ( const std::string &  type_id,
const Cont &  c,
std::enable_if_t< !jau::is_darray_type< Cont >::value, bool >  = true 
)
static

Definition at line 69 of file test_cow_darray_perf01.cpp.

◆ findDataSet01_idx()

template<class T , typename Size_type >
const DataType01 * findDataSet01_idx ( T &  data,
DataType01 const &  elem 
)
noexcept
Examples
test_cow_darray_perf01.cpp.

Definition at line 86 of file test_cow_darray_perf01.cpp.

◆ test_00_list_idx()

template<class T , typename Size_type >
static int test_00_list_idx ( T &  data)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 98 of file test_cow_darray_perf01.cpp.

◆ findDataSet01_itr() [1/2]

template<class T , typename Size_type >
const DataType01 * findDataSet01_itr ( T &  data,
DataType01 const &  elem,
std::enable_if_t< is_cow_type< T >::value, bool >  = true 
)
noexcept
Examples
test_cow_darray_perf01.cpp.

Definition at line 110 of file test_cow_darray_perf01.cpp.

◆ findDataSet01_itr() [2/2]

template<class T , typename Size_type >
const DataType01 * findDataSet01_itr ( T &  data,
DataType01 const &  elem,
std::enable_if_t< !is_cow_type< T >::value, bool >  = true 
)
noexcept

Definition at line 122 of file test_cow_darray_perf01.cpp.

◆ test_00_list_itr() [1/2]

template<class T >
static int test_00_list_itr ( T &  data,
std::enable_if_t< is_cow_type< T >::value, bool >  = true 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 136 of file test_cow_darray_perf01.cpp.

◆ test_00_list_itr() [2/2]

template<class T >
static int test_00_list_itr ( T &  data,
std::enable_if_t< !is_cow_type< T >::value, bool >  = true 
)
static

Definition at line 149 of file test_cow_darray_perf01.cpp.

◆ test_00_seq_find_idx()

template<class T , typename Size_type >
static void test_00_seq_find_idx ( T &  data)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 164 of file test_cow_darray_perf01.cpp.

◆ test_00_seq_find_itr()

template<class T , typename Size_type >
static void test_00_seq_find_itr ( T &  data)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 181 of file test_cow_darray_perf01.cpp.

◆ test_00_seq_fill()

template<class T , typename Size_type >
static void test_00_seq_fill ( T &  data,
const Size_type  size 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 198 of file test_cow_darray_perf01.cpp.

◆ test_00_seq_fill_unique_idx()

template<class T , typename Size_type >
static void test_00_seq_fill_unique_idx ( T &  data,
const Size_type  size 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 209 of file test_cow_darray_perf01.cpp.

◆ equal_comparator()

template<class value_type >
static bool equal_comparator ( const value_type &  a,
const value_type &  b 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 226 of file test_cow_darray_perf01.cpp.

◆ test_00_seq_fill_unique_itr() [1/2]

template<class T , typename Size_type >
static void test_00_seq_fill_unique_itr ( T &  data,
const Size_type  size,
std::enable_if_t< is_cow_type< T >::value, bool >  = true 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 231 of file test_cow_darray_perf01.cpp.

◆ test_00_seq_fill_unique_itr() [2/2]

template<class T , typename Size_type >
static void test_00_seq_fill_unique_itr ( T &  data,
const Size_type  size,
std::enable_if_t< !is_cow_type< T >::value, bool >  = true 
)
static

Definition at line 266 of file test_cow_darray_perf01.cpp.

◆ print_mem()

template<class T >
static void print_mem ( const std::string &  pre,
const T &  data 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 291 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

◆ test_01_seq_fill_list_idx()

template<class T , typename Size_type >
static bool test_01_seq_fill_list_idx ( const std::string &  type_id,
const Size_type  size0,
const Size_type  reserve0 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 309 of file test_cow_darray_perf01.cpp.

◆ test_01_seq_fill_list_footprint()

template<class T , typename Size_type >
static bool test_01_seq_fill_list_footprint ( const std::string &  type_id,
const Size_type  size0,
const Size_type  reserve0,
const bool  do_print_mem 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 334 of file test_cow_darray_perf01.cpp.

◆ test_01_seq_fill_list_itr()

template<class T , typename Size_type >
static bool test_01_seq_fill_list_itr ( const std::string &  type_id,
const Size_type  size0,
const Size_type  reserve0 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 366 of file test_cow_darray_perf01.cpp.

◆ test_02_seq_fillunique_find_idx()

template<class T , typename Size_type >
static bool test_02_seq_fillunique_find_idx ( const std::string &  type_id,
const Size_type  size0,
const Size_type  reserve0 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 391 of file test_cow_darray_perf01.cpp.

◆ test_02_seq_fillunique_find_itr()

template<class T , typename Size_type >
static bool test_02_seq_fillunique_find_itr ( const std::string &  type_id,
const Size_type  size0,
const Size_type  reserve0 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 415 of file test_cow_darray_perf01.cpp.

◆ footprint_fillseq_list_itr()

template<class T , typename Size_type >
static bool footprint_fillseq_list_itr ( const std::string &  type_id,
const bool  do_rserv 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 443 of file test_cow_darray_perf01.cpp.

◆ benchmark_fillseq_list_idx()

template<class T , typename Size_type >
static bool benchmark_fillseq_list_idx ( const std::string &  title_pre,
const std::string &  type_id,
const bool  do_rserv 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 458 of file test_cow_darray_perf01.cpp.

◆ benchmark_fillseq_list_itr()

template<class T , typename Size_type >
static bool benchmark_fillseq_list_itr ( const std::string &  title_pre,
const std::string &  type_id,
const bool  do_rserv 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 495 of file test_cow_darray_perf01.cpp.

◆ benchmark_fillunique_find_idx()

template<class T , typename Size_type >
static bool benchmark_fillunique_find_idx ( const std::string &  title_pre,
const std::string &  type_id,
const bool  do_rserv 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 528 of file test_cow_darray_perf01.cpp.

◆ benchmark_fillunique_find_itr()

template<class T , typename Size_type >
static bool benchmark_fillunique_find_itr ( const std::string &  title_pre,
const std::string &  type_id,
const bool  do_rserv 
)
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 565 of file test_cow_darray_perf01.cpp.

◆ TEST_CASE() [1/3]

TEST_CASE ( "Memory Footprint 01 - Fill Sequential and List"  ,
""  [datatype][footprint] 
)
Examples
test_cow_darray_perf01.cpp.

Definition at line 600 of file test_cow_darray_perf01.cpp.

◆ TEST_CASE() [2/3]

TEST_CASE ( "Perf Test 01 - Fill Sequential and  List,
empty and reserve"  ,
""  [datatype][sequential] 
)

Definition at line 623 of file test_cow_darray_perf01.cpp.

◆ TEST_CASE() [3/3]

TEST_CASE ( "Perf Test 02 - Fill Unique and  List,
empty and reserve"  ,
""  [datatype][unique] 
)

Definition at line 660 of file test_cow_darray_perf01.cpp.

Variable Documentation

◆ start_addr_b

uint8_t start_addr_b[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 79 of file test_cow_darray_perf01.cpp.

◆ start_addr

Addr48Bit start_addr(start_addr_b) ( start_addr_b  )
static