lean4-htt/library/init/lean/parser
Leonardo de Moura 1cb22b6801 perf(library/init/lean/parser/command): move common command parsers to the beginning of the list
@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.
2018-11-08 14:45:34 -08:00
..
basic.lean chore(library/init/lean/parser): do not expose the parser cache as monad_state 2018-11-08 16:01:19 +01:00
combinators.lean chore(library/init/lean/parser/combinators): node: small simplification 2018-11-08 10:43:17 +01:00
command.lean perf(library/init/lean/parser/command): move common command parsers to the beginning of the list 2018-11-08 14:45:34 -08:00
declaration.lean fix(library/init/lean/parser/declaration): precedence for attribute arguments 2018-10-30 17:43:05 +01:00
identifier.lean refactor(library/init/lean/parser/parsec): make sure custom error message doesn't need to be inhabited 2018-10-21 10:57:23 -07:00
level.lean chore(library/init/lean/parser): do not expose the parser cache as monad_state 2018-11-08 16:01:19 +01:00
module.lean perf(library/init/lean/parser): move backtrackable state from parser_core_t to module_parser_m 2018-11-08 15:58:41 +01:00
notation.lean perf(frontends/lean/elaborator,library/init/lean): put out_params first to benefit from instance pre-filtering 2018-10-30 17:43:05 +01:00
parsec.lean perf(library/init/lean/parser/parsec): optimize str and raw_str 2018-11-08 11:18:21 -08:00
pratt.lean chore(library/init/lean/parser): remove unnecessary class constraints 2018-11-06 21:45:08 +01:00
rec.lean refactor(library/init/lean/parser/parsec): make sure custom error message doesn't need to be inhabited 2018-10-21 10:57:23 -07:00
string_literal.lean refactor(library/init/lean/parser/parsec): make sure custom error message doesn't need to be inhabited 2018-10-21 10:57:23 -07:00
syntax.lean feat(library/init/lean/syntax): add lazily propagated macro scopes to syntax_node 2018-11-06 16:46:50 +01:00
term.lean perf(frontends/lean/elaborator,library/init/lean): put out_params first to benefit from instance pre-filtering 2018-10-30 17:43:05 +01:00
token.lean perf(library/init/lean/parser/token): optimize symbol 2018-11-08 14:05:09 -08:00
trie.lean refactor(library/init/data): avoid indirection at rbmap 2018-10-26 17:14:09 -07:00