Lean Kernel Arena / perf/beta-ladder

Test "perf/beta-ladder"

Expected: 👍 accept · Size: 450.6 KB · Lines: 10.4 k · lean4export: 3.1.0 · Lean: 4.36.0 · Timeout: 40.0 s · 📄 Declaration · 🔗 Source

The declaration to check reduces

(fun x₁ => … (fun xₙ => x₁ + (x₂ + (… + (xₙ + 0)))) 0 …) 0

to 0, through n beta redexes over a body that reads every binder.

Reducing the ladder takes n beta steps whatever a checker does, so the test is what one step costs. Substituting into the body on entry to binder k copies the n − k redexes still below it, and those copies sum to Θ(n²). Carrying the substitution in an environment leaves the body untouched, for Θ(n).

N=2000 in the Lean source.

Checker Result ⏱️ 🧠
nano-lean 👍 3.37 ms (÷496) 48.5 MB (÷11)
gruszka 👍 37.7 ms (÷44) 121.3 MB (÷4.3)
mathgraph 👍 31.7 ms (÷53) 94.2 MB (÷5.6)
sokonanoda 👍 31.5 ms (÷53) 94.0 MB (÷5.6)
pestka 👍 48.2 ms (÷35) 51.5 MB (÷10)
kefir 👍 16.2 ms (÷103) 18.4 MB (÷29)
kefir-wasm 👍 290 ms (÷5.8) 118.8 MB (÷4.4)
con-ron 👍 1.48 s (-12%) 625.1 MB (+19%)
con-ron-stream 👍 1.48 s (-12%) 635.4 MB (+21%)
con-agua 👍 1.90 s (+14%) 357.7 MB (-32%)
nanobruijn 👍 1.57 s (-6%) 824.8 MB (+57%)
nanoda 👍 1.26 s (-24%) 607.2 MB (+15%)
con-leche 👍 924 ms (-45%) 215.9 MB (÷2.4)
pestka-wasm 👍 791 ms (÷2.1) 625.8 MB (+19%)
official-nightly 👍 790 ms (÷2.1) 530.9 MB (+1%)
eink0rn 👍 686 ms (÷2.4) 94.9 MB (÷5.5)
official 👍 1.67 s 525.8 MB
ind-models 👍 1.74 s (+4%) 541.2 MB (+3%)
kiota 👍 531 ms (÷3.1) 844.8 MB (+61%)
tenet 👍 2.34 s (+40%) 573.7 MB (+9%)
tenet-hs 👍 3.20 s (+92%) 683.0 MB (+30%)
logos-kernel 👍 49.7 ms (÷34) 56.7 MB (÷9.3)
evmlean 🚫 7.70 s 392.4 MB
mini 👍 933 ms (-44%) 196.5 MB (÷2.7)
overfull ⌛ — —
lean4lean 👍 1.66 s (-1%) 524.8 MB (0%)
lean4cobol 👍 30.9 s (×18) 796.7 MB (+52%)
tenet-jvm 👍 2.16 s (+29%) 596.6 MB (+13%)
nanoclo 👍 6.16 ms (÷272) 47.5 MB (÷11)
vow-lean-kernel ⌛ — —
canonical-min ✋ 418 ms 1.0 GB
lazylean 👍 668 ms (÷2.5) 47.1 MB (÷11)
rpylean 👍 15.2 ms (÷110) 32.4 MB (÷16)
metalean-slow 🚫 77.8 ms 70.1 MB
metalean-fast 👍 3.44 s (×2.1) 655.2 MB (+25%)
nanoclo-fortran 👍 22.8 ms (÷73) 13.2 MB (÷40)