lean4-htt/tests/bench/mergeSort
..
.gitignore
Bench.lean chore: deprecate List.iota (#6708) 2025-01-21 02:32:35 +00:00
bench.py
lakefile.lean
lean-toolchain
README.md feat: List.mergeSort (#5092) 2024-08-20 06:32:52 +00:00

mergeSortBenchmark

Benchmarking List.mergeSort.

Run lake exe mergeSort k to run a benchmark on lists of size k * 10^5. This reports the average time (in milliseconds) to sort:

  • an already sorted list
  • a reverse sorted list
  • an almost sorted list
  • and a random list with duplicates

Run python3 bench.py to run this for k = 1, .., 10, and calculate a best fit of the model A * k + B * k * log k to the observed runtimes. (This isn't really what one should do: fitting a log to data across a single order of magnitude is not helpful.)