string_benchmark

Simple non-academic performance comparison of various operations on C++ strings: C strings, character arrays, std::string and std::wstring classes as well as some of the Boost string algorithms.

The benchmarks use Celero library.

The tests use Catch.

Build Status

Branch Travis CI AppVeyor
master status status

Results

See charts generate with Bokeh.

Detailed results are displayed in tabular form in the Travis CI and AppVeyor build logs.

Usage

Build and run the benchmark with:

Unix

cmake -DCMAKE_BUILD_TYPE=Release /path/to/string_benchmark
make

Windows

cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT=C:/local/boost_1_63_0 /path/to/string_benchmark
msbuild /p:Configuration=Release /p:Platform=x64 string_benchmark.sln

Run

CMake generates RUN target. It runs all benchmarks automatically after successful build and tests run, saving results in CSV files named after benchmark programs.

Celero command line options are available.

benchmark_iends_with -t benchmark_iends_with.csv
benchmark_istarts_with -t benchmark_istarts_with.csv

Credits

Disclaimer

This project is driven by curiosity and for my own purposes. This is not a rocket science, but a simple set of C++ programs, with likelyhood of bugs, incorrectness or inconsistencies. Found any, please report. Comments and improvements are always welcome!