Skip to content

Instantly share code, notes, and snippets.

// source code for the post https://cppbenchmarks.wordpress.com/2020/11/10/float-division-vs-multiplication-speed/
#include <array>
#include <chrono>
#include <numeric>
#include <iostream>
float doNotOptimizeAway = 0.0F;
template <int nElements> std::chrono::microseconds benchmarkMultiplicationF32() {
#include <iostream>
#include <random>
#include <chrono>
#include <iomanip>
template <typename RandomEngineType> void benchmark_random_generator(const std::string &name) {
RandomEngineType generator;
std::uniform_int_distribution<> distribution(0, 1000);
// source code for the post https://cppbenchmarks.wordpress.com/2020/08/25/benchmarking-stdvector-and-stdlist-sorting-performance/
#include <vector>
#include <list>
#include <iostream>
#include <chrono>
#include <algorithm>
struct BloatedInt {
// source code for the post https://cppbenchmarks.wordpress.com/2020/08/25/benchmarking-stdvector-and-stdlist-sorting-performance/
#include <vector>
#include <list>
#include <iostream>
#include <chrono>
#include <algorithm>
using ElementType = int32_t;