For example, in the new test `qsort64.lean`, the new optimization prevents the repeated execution of `box UInt64.inhabited`. On my machine ``` ./run.sh qsort64.lean 2000000 ``` Goes from 1.22s to 0.355s
6 lines
232 B
Text
6 lines
232 B
Text
-- set_option trace.compiler.ir.boxing true
|
|
|
|
def main (xs : List String) : IO Unit :=
|
|
do
|
|
let a := xs.head.toNat.fold (fun i (a : Array UInt64) => a.push (UInt64.ofNat i)) Array.empty;
|
|
IO.println $ (a.qsort (fun x y => x > y)).get 0
|