← Back to Projects
βš™οΈ cpp 2024

Memory Allocator Benchmark

Benchmarks different memory allocation methods in C++. malloc/free vs new/delete, fixed vs random allocation sizes.

Preview

portfolio β€” bash

$ ./allocator-bench --iterations 100000 --mode fixed

πŸ”¬ Memory allocation benchmark (100,000 iterations): malloc/free: 12.4 ms (avg 124 ns/allocation) new/delete: 14.1 ms (avg 141 ns/allocation) allocator: 9.8 ms (avg 98 ns/allocation)

$ ./allocator-bench --iterations 100000 --mode random

πŸ”¬ Benchmark β€” random sizes: malloc/free: 18.7 ms new/delete: 21.3 ms allocator: 13.2 ms πŸ† Best: custom allocator (29.8% faster)

Tech Stack

  • C++
  • CMake

Description

Benchmarks different memory allocation methods in C++. malloc/free vs new/delete, fixed vs random allocation sizes.