lean4-htt/src/Init
Marc Huisinga 9009c1ac91
fix: ilean loading performance (#4900)
This PR roughly halves the time needed to load the .ilean files by
optimizing the JSON parser and the conversion from JSON to Lean data
structures.

The code is optimized roughly as follows:
- String operations are inlined more aggressively
- Parsers are changed to use new `String.Iterator` functions `curr'` and
`next'` that receive a proof and hence do not need to perform an
additional check
- The `RefIdent` of .ilean files now uses a `String` instead of a `Name`
to avoid the expensive parse step from `String` to `Name` (despite the
fact that we only very rarely actually need a `Name` in downstream code)
- Instead of `List`s and `Subarray`s, the JSON to Lean conversion now
directly passes around arrays and array indices to avoid redundant
boxing
- Parsec's `peek?` sometimes generates redundant `Option` wrappers
because the generation of basic blocks interferes with the ctor-match
optimization, so it is changed to use an `isEof` check where possible
- Early returns and inline-do-blocks cause the code generator to
generate new functions, which then interfere with optimizations, so they
are now avoided
- Mutual defs are used instead of unspecialized passing of higher-order
functions to generate faster code
- The object parser is made tail-recursive

This PR also fixes a stack overflow in `Lean.Json.compress` that would
occur with long lists and adds a benchmark for the .ilean roundtrip
(compressed pretty-printing -> parsing).
2024-08-29 11:51:48 +00:00
..
Control chore: reduce usage of refine' (#5042) 2024-08-14 15:14:44 +00:00
Data fix: ilean loading performance (#4900) 2024-08-29 11:51:48 +00:00
Grind feat: add grind core module (#4249) 2024-05-22 03:50:36 +00:00
Omega chore: remove bad simp lemma in omega theory (#5156) 2024-08-25 07:47:16 +00:00
System feat: support for secure temporary files (#5125) 2024-08-22 13:01:40 +00:00
BinderPredicates.lean chore: upstream set notation (#3339) 2024-02-15 02:08:45 +00:00
ByCases.lean chore: cleanup #5167 workarounds after update stage0 (#5175) 2024-08-26 17:53:30 +00:00
Classical.lean doc: Classical.choice (#3871) 2024-04-22 06:36:56 +00:00
Coe.lean fix: make Lean.Internal.liftCoeM and Lean.Internal.coeM unfold (#3404) 2024-02-27 22:17:46 +00:00
Control.lean feat: add ExceptCpsT 2021-02-27 18:44:24 -08:00
Conv.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
Core.lean chore: @[elab_as_elim] additions (#5147) 2024-08-26 07:44:54 +00:00
Data.lean feat: basic instances for ULift and PLift (#5112) 2024-08-21 11:37:13 +00:00
Dynamic.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Ext.lean feat: add [ext] attribute to Array.ext (#4970) 2024-08-09 12:40:39 +00:00
GetElem.lean fix: get_elem_tactic_trivial to not loop in the presence of mvars (#5119) 2024-08-21 19:51:58 +00:00
Grind.lean feat: add grind core module (#4249) 2024-05-22 03:50:36 +00:00
Guard.lean feat: upstream guard_expr (#3297) 2024-02-11 23:25:04 +00:00
Hints.lean fix: Not should not be reducible, special support for Ne 2021-02-15 17:36:11 -08:00
MacroTrace.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
Meta.lean fix: ilean loading performance (#4900) 2024-08-29 11:51:48 +00:00
MetaTypes.lean feat: expose index option to dsimp tactic (#5071) 2024-08-19 07:57:16 +00:00
Notation.lean feat: swap arguments to Membership.mem (#5020) 2024-08-26 12:35:47 +00:00
NotationExtra.lean feat: PProd syntax (part 3) (#4756) 2024-07-16 21:06:04 +00:00
Omega.lean chore: add missing copyright headers (#3411) 2024-02-20 01:49:55 +00:00
Prelude.lean feat: swap arguments to Membership.mem (#5020) 2024-08-26 12:35:47 +00:00
PropLemmas.lean feat: lemmas about if-then-else improving confluence (#5191) 2024-08-28 23:10:13 +00:00
RCases.lean doc: typo in rcases docs (#3796) 2024-03-28 07:31:01 +00:00
ShareCommon.lean refactor: sharecommon (#4887) 2024-07-31 19:13:12 +00:00
SimpLemmas.lean chore: running the simpNF linter over Lean (#5133) 2024-08-24 07:10:07 +00:00
Simproc.lean chore: fix simproc doc-string (#3800) 2024-03-28 17:54:52 +00:00
SizeOf.lean doc: documentation for Init.SizeOf 2022-08-17 14:48:10 -07:00
SizeOfLemmas.lean fix: protect sizeOf lemmas 2023-07-19 08:50:59 +02:00
System.lean feat: Mutex, Condvar 2022-09-05 08:52:46 -07:00
Tactics.lean doc: unfold tactic docstring (#5109) 2024-08-22 13:58:42 +00:00
TacticsExtra.lean feat: incremental next and tactic if (#4459) 2024-06-18 12:36:59 +00:00
Util.lean feat: add some low level helper APIs (#4778) 2024-07-17 20:12:05 +00:00
WF.lean chore: deprecate Nat.strongInductionOn (#5179) 2024-08-27 07:18:06 +00:00
WFTactics.lean chore: cleanup #5167 workarounds after update stage0 (#5175) 2024-08-26 17:53:30 +00:00