JayBeams  0.1
Another project to have fun coding.
Namespaces | Macros | Functions
bm_order_book.cpp File Reference

This is a benchmark for jb::itch5::array_based_order_book and jb::itch5::map_based_order_book. More...

#include <jb/itch5/array_based_order_book.hpp>
#include <jb/itch5/map_based_order_book.hpp>
#include <jb/itch5/price_levels.hpp>
#include <jb/testing/initialize_mersenne_twister.hpp>
#include <jb/testing/microbenchmark.hpp>
#include <jb/histogram.hpp>
#include <jb/integer_range_binning.hpp>
#include <jb/log.hpp>
#include <functional>
#include <stdexcept>
#include <type_traits>
#include <unordered_map>

Go to the source code of this file.

Namespaces

 defaults
 Define defaults for program parameters.
 

Macros

#define JB_ITCH5_DEFAULT_bm_order_book_test_case   "array"
 
#define JB_ITCH5_DEFAULT_bm_order_book_p25   0
 
#define JB_ITCH5_DEFAULT_bm_order_book_p50   1
 
#define JB_ITCH5_DEFAULT_bm_order_book_p75   6
 
#define JB_ITCH5_DEFAULT_bm_order_book_p90   14
 
#define JB_ITCH5_DEFAULT_bm_order_book_p99   203
 
#define JB_ITCH5_DEFAULT_bm_order_book_p999   2135
 
#define JB_ITCH5_DEFAULT_bm_order_book_p100   20000000
 
#define JB_ITCH5_DEFAULT_bm_order_book_max_p999_delta   200
 
#define JB_ITCH5_DEFAULT_bm_order_book_min_qty   -5000
 
#define JB_ITCH5_DEFAULT_bm_order_book_max_qty   5000
 

Functions

int main (int argc, char *argv[])
 

Detailed Description

This is a benchmark for jb::itch5::array_based_order_book and jb::itch5::map_based_order_book.

It computes a valid stream of book operations, and runs the operations over the book type multiple times to measure its performance and variability.

Some effort is made to make sure the stream of book operations is statistically similar to the observed behaviour of the ITCH-5.0 feed.

To make the test reproduceable, the user can pass in the seed to the PRNGs used to create the stream of book operations.

The program uses the jb::microbenchmark<> class, taking advantage of common features such as command-line configurable number of iterations, scheduling attributes, warmup cycles, etc.

Definition in file bm_order_book.cpp.

Macro Definition Documentation

◆ JB_ITCH5_DEFAULT_bm_order_book_max_p999_delta

#define JB_ITCH5_DEFAULT_bm_order_book_max_p999_delta   200

Definition at line 315 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_max_qty

#define JB_ITCH5_DEFAULT_bm_order_book_max_qty   5000

Definition at line 323 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_min_qty

#define JB_ITCH5_DEFAULT_bm_order_book_min_qty   -5000

Definition at line 319 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p100

#define JB_ITCH5_DEFAULT_bm_order_book_p100   20000000

Definition at line 311 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p25

#define JB_ITCH5_DEFAULT_bm_order_book_p25   0

Definition at line 287 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p50

#define JB_ITCH5_DEFAULT_bm_order_book_p50   1

Definition at line 291 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p75

#define JB_ITCH5_DEFAULT_bm_order_book_p75   6

Definition at line 295 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p90

#define JB_ITCH5_DEFAULT_bm_order_book_p90   14

Definition at line 299 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p99

#define JB_ITCH5_DEFAULT_bm_order_book_p99   203

Definition at line 303 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_p999

#define JB_ITCH5_DEFAULT_bm_order_book_p999   2135

Definition at line 307 of file bm_order_book.cpp.

◆ JB_ITCH5_DEFAULT_bm_order_book_test_case

#define JB_ITCH5_DEFAULT_bm_order_book_test_case   "array"

Definition at line 283 of file bm_order_book.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 240 of file bm_order_book.cpp.

References jb::usage::exit_status(), jb::log::init(), and JB_LOG.