lean4-htt/tests/bench/mergeSort
Kim Morrison 16bd7ea455
chore: deprecate List.iota (#6708)
This PR deprecates `List.iota`, which we make no essential use of. `iota
n` can be replaced with `(range' 1 n).reverse`. The verification lemmas
for `range'` already have better coverage than those for `iota`.
Any downstream projects using it (I am not aware of any) are encouraged
to adopt it.
2025-01-21 02:32:35 +00:00
..
.gitignore
Bench.lean
bench.py
lakefile.lean
lean-toolchain
README.md

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.)