Commit 9ec8d13
committed
perf: relax OCaml 5.x GC pacing for custom blocks, warn on 5.0–5.3
EasyCrypt hash-conses its AST and allocates zarith/GMP custom blocks
heavily. On OCaml 5.x the default custom_major_ratio paces the major GC
far too aggressively over that external memory (OCaml issue #14533,
pronounced on 5.5), costing large amounts of CPU for no memory benefit:
compiling a large file (NTTAlgebra.ec) measured ~5x slower than on 4.14
(1255s vs 339s), with the same ~1GB working set.
Set custom_major_ratio to 250 on OCaml >= 5, which restores 4.14-class
performance (5.5: 1255s -> 233s). This is a no-op on 5.4, whose default
pacing is already fine, and harmless there.
Additionally, warn at startup on OCaml 5.0–5.3, whose minor GC
over-promotes values reachable from ephemeron/weak-table keys (OCaml
issue #13643), causing severe memory blowup with EasyCrypt's weak-table
hash-consing. Fixed upstream in OCaml 5.4; recommend upgrading.1 parent 0096d84 commit 9ec8d13
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
9 | 39 | | |
10 | 40 | | |
11 | 41 | | |
| |||
117 | 147 | | |
118 | 148 | | |
119 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
120 | 154 | | |
121 | 155 | | |
122 | 156 | | |
| |||
708 | 742 | | |
709 | 743 | | |
710 | 744 | | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
711 | 748 | | |
712 | 749 | | |
713 | 750 | | |
| |||
0 commit comments