`fix.lean` and `fix_1.lean` are very similar, but fix.lean is almost twice as fast. Reason: `fix.lean` uses `fix_2` instead of `fix_1` and avoid the creation of many closures. Here are runtime numbers on my machine. ``` time ./fix_1.lean.out 23 352321527 real 0m0.729s user 0m0.724s sys 0m0.000s ``` ``` ~/projects/lean4/tests/playground (master +)$ time ./fix.lean.out 23 352321527 real 0m0.396s user 0m0.388s sys 0m0.004s ``` TODO: modify the compiler to replace `fix_core_n f a_1 ... a_m` with `fix_core_m f a_1 ... a_m` whenever `n < m`. This feature is quite useful for writing reusable/generic code. For example, we cannot write an efficient `rec_t` without it because we don't know the arity of `m A` when we write `rec_t`. |
||
|---|---|---|
| .. | ||
| compiler | ||
| ir | ||
| lean | ||
| playground | ||