Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Macros | Functions | Variables
test_cow_darray_perf01.cpp File Reference
#include <iostream>
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <random>
#include <vector>
#include <catch2/catch_amalgamated.hpp>
#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 CATCH_CONFIG_RUNNER
 
#define RUN_RESERVE_BENCHMARK   0
 
#define RUN_INDEXED_BENCHMARK   0
 

Functions

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 , typename Size_type >
const DataType01findDataSet01_idx (T &data, DataType01 const &elem) noexcept
 
template<class T , typename Size_type >
static int test_00_list_idx (T &data)
 
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 >
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_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 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 value_type >
static bool equal_comparator (const value_type &a, const value_type &b)
 
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) noexcept
 
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) noexcept
 
template<class T >
static void print_mem (const std::string &pre, const T &data)
 
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_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_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)
 
template<class T , typename Size_type >
static bool footprint_fillseq_list_itr (const std::string &type_id, const bool do_rserv)
 
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)
 
 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 uint8_t start_addr_b [] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 
static Addr48Bit start_addr (start_addr_b)
 

Macro Definition Documentation

◆ CATCH_CONFIG_RUNNER

#define CATCH_CONFIG_RUNNER

Definition at line 32 of file test_cow_darray_perf01.cpp.

◆ RUN_INDEXED_BENCHMARK

#define RUN_INDEXED_BENCHMARK   0

Definition at line 54 of file test_cow_darray_perf01.cpp.

◆ RUN_RESERVE_BENCHMARK

#define RUN_RESERVE_BENCHMARK   0

Definition at line 53 of file test_cow_darray_perf01.cpp.

Function Documentation

◆ 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 461 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 498 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 531 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 568 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 229 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 89 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

Definition at line 125 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
Examples
test_cow_darray_perf01.cpp.

Definition at line 113 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 446 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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

Definition at line 72 of file test_cow_darray_perf01.cpp.

◆ 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
Examples
test_cow_darray_perf01.cpp.

Definition at line 59 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

◆ 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 294 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 101 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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

Definition at line 152 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
Examples
test_cow_darray_perf01.cpp.

Definition at line 139 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 201 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 212 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 
)
staticnoexcept

Definition at line 269 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 
)
staticnoexcept
Examples
test_cow_darray_perf01.cpp.

Definition at line 234 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 167 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 184 of file test_cow_darray_perf01.cpp.

Here is the call graph for this function:

◆ 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 337 of file test_cow_darray_perf01.cpp.

Here is the call 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 312 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 369 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 394 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 418 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 603 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 626 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 663 of file test_cow_darray_perf01.cpp.

Variable Documentation

◆ start_addr

Addr48Bit start_addr(start_addr_b)
static

◆ start_addr_b

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

Definition at line 82 of file test_cow_darray_perf01.cpp.