Performance Benchmarking with Celero
summary
Small C++11 library Celero adds microbenchmarks to projects and produces CSV/JUnit/archived results for CI; it runs 10,000 samples with inner loops (example used 1,000 iterations) and enforces work with DoNotOptimizeAway. Example: a crafted baseline yields relative timings where std::to_string is about 2x slower than baseline and std::strstream about 19x slower, while a table lookup is ~0.96×. Problem spaces scale (64→4096 elements) and bubble sort baselines expose how other algorithms outperform it; outputs aim for reproducible minima.
AI-written summary · about
chapters (13)
- 0:00Introduction to Celero
- 1:50What is Celero
- 2:56Microbenchmarking basics
- 6:10Benchmarking challenges
- 13:45Int to string example
- 19:07Writing test cases
- 23:02Test fixtures and baselines
- 27:25Problem spaces in tests
- 31:54Guidelines and best practices
- 36:14Analyzing results
- 38:22Continuous testing integration
- 42:14Future improvements
- 43:40Q&A
related talks
01h 30mTuning C++: Benchmarks, and CPUs, and Compilers! Oh My!
11mBenchmarking in C++
02h 44mMeasure, don’t guess: benchmarking stories from the trenches
58mRefresher on Containers, Algorithms and Performance
02h 41mMicro Benchmarking - The Art of Realizing One is Wrong
49mAn Engineering Approach to Optimising C++
43mStop Guessing and Start Measuring - Benchmarking in Practice
01h 00mMoving Faster: Everyday efficiency in modern C++
