@kha This modification saved 150k object allocations on my machine. BTW, the function ``` def command_parser.run (commands : list command_parser) (p : command_parser) : parser_t command_parser_config id syntax := λ cfg, (p.run cfg).run_parsec $ λ _, any_of $ commands.map (λ p, p.run cfg) ``` is also affected by the problem I described at Zulip. It is another example where eager eta-expansion is bad. Every time we call it, we will create approx. 20 closures and 20 cons memory cells. We have at least 600 commands in core.lean. So, just the `map` nested there will generate 24k memory allocations. Moreover, the problem will get worse as we add more commands. |
||
|---|---|---|
| .. | ||
| init | ||
| leanpkg.path | ||
| library.md | ||
| Makefile.in | ||
| relative.py | ||