chunkedseq
container library for large in-memory data sets
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Typedefs | Functions | Variables
bench.cpp File Reference
#include <functional>
#include <random>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#include "cmdline.hpp"
#include "atomic.hpp"
#include "microtime.hpp"
#include "container.hpp"
#include "fixedcapacity.hpp"
#include "chunkedseq.hpp"
#include "chunkedbag.hpp"
#include "map.hpp"
#include "cachedmeasure.hpp"

Go to the source code of this file.

Macros

#define PAYLOAD   16
 

Typedefs

typedef size_t result_t
 
typedef std::function< void()> thunk_t
 
template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using mystack = chunkedseq::bootstrapped::stack< Item, Chunk_capacity, Cache >
 
template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using mybag = chunkedseq::bootstrapped::bagopt< Item, Chunk_capacity, Cache >
 
template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using myfftreestack = chunkedseq::ftree::stack< Item, Chunk_capacity, Cache >
 
template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using myfftreebag = chunkedseq::ftree::bagopt< Item, Chunk_capacity, Cache >
 

Functions

void failwith (std::string s)
 
unsigned myrand ()
 
void mysrand (unsigned seed)
 
template<class Datastruct >
void shuffle (Datastruct &d)
 
template<class Datastruct >
thunk_t scenario_test ()
 
template<class Datastruct , bool SkipPop>
thunk_t scenario_lifo_with_or_without_pop ()
 
template<class Datastruct >
thunk_t scenario_lifo ()
 
template<class Datastruct >
thunk_t scenario_fill_back ()
 
template<class Datastruct >
thunk_t scenario_fifo ()
 
template<class Datastruct , bool should_push, bool should_pop>
void _scenario_split_merge (Datastruct *ds, size_t n, size_t p, size_t r, size_t h)
 
template<class Datastruct >
thunk_t scenario_split_merge ()
 
template<class Datastruct , class Filter >
void filter (Datastruct &dst, Datastruct &src, const Filter &filt, int cutoff)
 
template<class Datastruct >
thunk_t scenario_filter ()
 
template<class Map , class Obj >
thunk_t scenario_map ()
 
template<class Sequence >
void dispatch_by_scenario ()
 
template<template< class Item, int Chunk_capacity=512, class Cache=pasl::data::cachedmeasure::trivial< Item, size_t >, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct=pasl::data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc=std::allocator< Item > > class SeqStruct, class Item , template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct>
void dispatch_for_chunkedseq ()
 
template<class Item >
void dispatch_by_sequence ()
 
void dispatch_by_itemsize ()
 
void dispatch_by_map ()
 
void dispatch_by_benchmark_mode ()
 
int main (int argc, char **argv)
 

Variables

result_t res = 0
 
double exec_time
 
unsigned rand_seed
 

Macro Definition Documentation

#define PAYLOAD   16

Definition at line 389 of file bench.cpp.

Typedef Documentation

template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using mybag = chunkedseq::bootstrapped::bagopt<Item, Chunk_capacity, Cache>

Definition at line 584 of file bench.cpp.

template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using myfftreebag = chunkedseq::ftree::bagopt<Item, Chunk_capacity, Cache>

Definition at line 599 of file bench.cpp.

template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using myfftreestack = chunkedseq::ftree::stack<Item, Chunk_capacity, Cache>

Definition at line 592 of file bench.cpp.

template<class Item , int Chunk_capacity = 512, class Cache = data::cachedmeasure::trivial<Item, size_t>, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct = data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc = std::allocator<Item>>
using mystack = chunkedseq::bootstrapped::stack<Item, Chunk_capacity, Cache>

Definition at line 577 of file bench.cpp.

typedef size_t result_t

Definition at line 41 of file bench.cpp.

typedef std::function<void ()> thunk_t

Definition at line 43 of file bench.cpp.

Function Documentation

template<class Datastruct , bool should_push, bool should_pop>
void _scenario_split_merge ( Datastruct *  ds,
size_t  n,
size_t  p,
size_t  r,
size_t  h 
)

Definition at line 267 of file bench.cpp.

void dispatch_by_benchmark_mode ( )

Definition at line 691 of file bench.cpp.

void dispatch_by_itemsize ( )

Definition at line 651 of file bench.cpp.

void dispatch_by_map ( )

Definition at line 666 of file bench.cpp.

template<class Sequence >
void dispatch_by_scenario ( )

Definition at line 529 of file bench.cpp.

template<class Item >
void dispatch_by_sequence ( )

Definition at line 602 of file bench.cpp.

template<template< class Item, int Chunk_capacity=512, class Cache=pasl::data::cachedmeasure::trivial< Item, size_t >, template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct=pasl::data::fixedcapacity::heap_allocated::ringbuffer_ptr, class Item_alloc=std::allocator< Item > > class SeqStruct, class Item , template< class Chunk_item, int Cap, class Item_alloc2=std::allocator< Item >> class Chunk_struct>
void dispatch_for_chunkedseq ( )

Definition at line 554 of file bench.cpp.

void failwith ( std::string  s)
Todo:
see cmdline invalid argument

Definition at line 46 of file bench.cpp.

template<class Datastruct , class Filter >
void filter ( Datastruct &  dst,
Datastruct &  src,
const Filter &  filt,
int  cutoff 
)

Definition at line 336 of file bench.cpp.

int main ( int  argc,
char **  argv 
)

Definition at line 698 of file bench.cpp.

unsigned myrand ( )

Definition at line 68 of file bench.cpp.

void mysrand ( unsigned  seed)

Definition at line 75 of file bench.cpp.

template<class Datastruct >
thunk_t scenario_fifo ( )

Definition at line 238 of file bench.cpp.

template<class Datastruct >
thunk_t scenario_fill_back ( )

Definition at line 233 of file bench.cpp.

template<class Datastruct >
thunk_t scenario_filter ( )

Definition at line 356 of file bench.cpp.

template<class Datastruct >
thunk_t scenario_lifo ( )

Definition at line 228 of file bench.cpp.

template<class Datastruct , bool SkipPop>
thunk_t scenario_lifo_with_or_without_pop ( )
Todo:
factorize fifo and lifo

Definition at line 197 of file bench.cpp.

template<class Map , class Obj >
thunk_t scenario_map ( )

Definition at line 392 of file bench.cpp.

template<class Datastruct >
thunk_t scenario_split_merge ( )

Definition at line 311 of file bench.cpp.

template<class Datastruct >
thunk_t scenario_test ( )

Definition at line 164 of file bench.cpp.

template<class Datastruct >
void shuffle ( Datastruct &  d)

Definition at line 153 of file bench.cpp.

Variable Documentation

double exec_time

Definition at line 52 of file bench.cpp.

unsigned rand_seed

Definition at line 66 of file bench.cpp.

result_t res = 0

Definition at line 51 of file bench.cpp.