A Suite of C++ Benchmarks for LibRapid, comparing it against Eigen and XTensor.
If you know how to increase the performance of any benchmarks here, please feel free to create a pull request with some changes. Ideally, we'll be benchmarking the optimal performance of each of these libraries.
Additionally, I only have access to a single machine, so if you want to run the benchmark on your own machine and have the results included, please create a pull request specifying the specs of your machine and the result of a given benchmark!
Each benchmark is contained in a different file, and can be found in benchmarks/src/*.cpp
. If you want to change the
configuration for a given benchmark, edit the JSON object for it in main.cpp
and recompile the program.
Current benchmarks include:
- Arithmetic operations (currently just array-array addition)
- Matrix transposition
To run the benchmarks, you can follow these steps:
git clone --recursive https://github.com/LibRapid/BenchmarksCPP.git
cd BenchmarksCPP
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
The exact location of the executable will depend on your operating system, but it will be in the build
directory.
# Linux
./BenchmarkCPP
# Windows
./release/BenchmarkCPP.exe
This repository contains some scripts to help interpret the results of the benchmarks. The executable writes the results
to CSV files in the same directory as the executable. To plot the results, you can use the dataProcessor.py
script in
./scripts/
.
You can use --help
to see the available options.
Simply specify an input file/directory and an output location, and the script will generate a plot for each benchmark. You can specify whether to plot the graphs relative to a given library, or to plot the absolute performance.
The benchmark results are stored as artefacts on LibRapid's CI pipeline, and can also be found on the LibRapid website
LibRapid's goal is to be as fast as physically possible, while still presenting a simple-to-use interface.
If you want to improve LibRapid's performance, find a bug, or believe something is not fast enough, please feel free to create a pull request or file an issue. Additionally, if you need to talk with me or anyone else supporting the library, our Discord server is a great place to ask questions and get help.