Skip to content

abarkov/item-performance

Repository files navigation

Compiling and running without Google Benchmark library
======================================================
make -f Makefile.standalone
./test


Compiling and running with Google Benchmark libary
==================================================

Linux:

git clone https://github.com/abarkov/item-performance.git
cd item-performance
git submodule init
git submodule update
mkdir build_rel
cd build_rel
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake --build .
./test
./gbench


Windows:

git clone https://github.com/abarkov/item-performance.git
cd item-performance
git submodule init
git submodule update
mkdir build_rel
cd build_rel
cmake ..
cmake --build . --config RelWithDebInfo
.\RelWithDebInfo\test.exe
.\RelWithDebInfo\gbench.exe


Available command line options:
==============================
To see available option lists, run:

./test -?


How to run tests
================
- run all tests with the default count:

  ./test

- run all tests with the specified count:

  ./test --count=1000000

- run some tests (specified by the mask) with the default count:

  ./test null     # Expressions related to NULL
  ./test bool     # Expressions related to the bool data type
  ./test double   # Expressions related to the double data type
  ./test ll       # Expressions related to the longlong data type

  ./test null bool # Multiple mask values are allowed

- run some tests with the specified count:

  ./test --count=1000000 ll


Description
===========

The program runs benchmarks for various ways of getting Item values for
the following data types:
- bool
- double
- longlong
- int32

The int32 methods were added to see if using the int32 API
(when data ranges allow to do so) would be faster than the longlong API. 

In addition to the traditional MySQL/MariaDB methods
val_bool(), val_int(), val_real(), 
every listed above data type has the following three new methods
(using "double" as an example):

 virtual double val_real_null(bool *null_value_arg); // Pass NULL flag by ptr
 virtual bool get_double(double *to);                // Return NULL flag
 virtual Double_null to_double_null();               // Return a struct


How to read test results:
========================

The following columns are printed:

1) compiler (e.g. "gcc" or "clang")
2) the value method name used
3) time spent (the smaller - the better)
4) SQL expression tested
5) Sum of all not null results (to make sure that different value methods
   return the same sum).

Method names printed in test results, using double related methods
as an example:

val_real       - double val_xxx() - with Item::null_value - current aproach
val_real_null  - double val_real_null(bool *null_value)"  - NULL flag as outvar
get_double     - bool get_double(double *val)             - Return NULL flag
to_double_null - Double_null to_double_null()             - Return a struct


TODO
====
- Add Item_field
- Add Item_func_eq
- Add Item_equal

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published