jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
test_cow_darray_perf01.cpp File Reference
#include <cassert>
#include <cstring>
#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) noexcept
 
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 46 of file test_cow_darray_perf01.cpp.

◆ RUN_INDEXED_BENCHMARK

#define RUN_INDEXED_BENCHMARK   0

Definition at line 47 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 53 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 67 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 84 of file test_cow_darray_perf01.cpp.

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller 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 179 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

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

Here is the caller 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 207 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

◆ equal_comparator()

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

Definition at line 224 of file test_cow_darray_perf01.cpp.

Here is the caller 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 )
static
Examples
test_cow_darray_perf01.cpp.

Definition at line 229 of file test_cow_darray_perf01.cpp.

Here is the caller 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 )
static

Definition at line 264 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 289 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 307 of file test_cow_darray_perf01.cpp.

Here is the caller 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 332 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller 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 493 of file test_cow_darray_perf01.cpp.

Here is the caller 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 526 of file test_cow_darray_perf01.cpp.

Here is the caller 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 563 of file test_cow_darray_perf01.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [1/3]

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

Definition at line 598 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 621 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 658 of file test_cow_darray_perf01.cpp.

Variable Documentation

◆ start_addr_b

uint8_t start_addr_b[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
static

Definition at line 77 of file test_cow_darray_perf01.cpp.

◆ start_addr