lean4-htt/tests/bench/mergeSort
Marc Huisinga 168c125cf5
chore: relative lean-toolchains (#12652)
This PR changes all `lean-toolchain` to use relative toolchain paths
instead of `lean4` and `lean4-stage0` identifiers, which removes the
need for manually linking toolchains via Elan.

After this PR, at least Elan 4.2.0 and 0.0.224 of the Lean VS Code
extension will be needed to edit core.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 10:23:35 +00:00
..
.gitignore
Bench.lean
bench.py
lakefile.lean
lean-toolchain chore: relative lean-toolchains (#12652) 2026-02-25 10:23:35 +00:00
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.)