.. _l-cpp-benchmark-report: Benchmark report in C++ ======================= This page documents ``examples/benchmark_report`` (`view on GitHub `_). The program reads a CSV file with benchmark logs, declares the role of every column, adds a value computed with a C++ formula, then prints a pivot view, an aggregated view and a side by side comparison of two exporters. Step 1 -- Install the C++ library --------------------------------- From the repository root: .. code-block:: bash cmake -S . -B build/install-lib -DCMAKE_BUILD_TYPE=Release \ -DDATA_CUBE_BUILD_PYTHON=OFF -DCMAKE_INSTALL_PREFIX= cmake --build build/install-lib --parallel cmake --install build/install-lib Step 2 -- Build and run the example ----------------------------------- .. code-block:: bash cmake -S examples/benchmark_report -B build/examples/benchmark_report \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH= cmake --build build/examples/benchmark_report ./build/examples/benchmark_report/benchmark_report [file.csv] Both steps are done by ``bash examples/build.sh``. CMakeLists.txt -------------- .. literalinclude:: ../../examples/benchmark_report/CMakeLists.txt :language: cmake :lines: 17- main.cc ------- .. literalinclude:: ../../examples/benchmark_report/main.cc :language: cpp Data ---- .. literalinclude:: ../../examples/benchmark_report/data.csv :language: text Output ------ The two views (the description and the side by side are skipped): .. code-block:: text -- speedup METRICS speedup speedup speedup speedup speedup exporter dynamo dynamo dynamo export export opt O0 O2 O2 O2 O2 date 2025-01-02 00:00:00 2025-01-01 00:00:00 2025-01-02 00:00:00 2025-01-01 00:00:00 2025-01-02 00:00:00 model_name llama 0.8749999999999999 1.206896551724138 1.2499999999999998 1.129032258064516 NaN phi3 NaN 1.25 1.3636363636363635 1.4999999999999998 1.6666666666666667 phi4 NaN NaN 1.368421052631579 1.3 1.2380952380952381 [3 rows x 5 columns] -- aggregated date 2025-01-01 00:00:00 2025-01-02 00:00:00 exporter METRICS dynamo speedup 1.228448275862069 1.2142643540669855 dynamo time_latency 0.29 0.4 export speedup 1.3096774193548386 1.4523809523809526 export time_latency 0.31 0.21 [4 rows x 2 columns]