-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce parser memoization to avoid exponentional behavior #1799
Conversation
!bench |
Here are the benchmark results for commit cf3b001. Benchmark Metric Change
=====================================================
- stdlib compilation new 2% (49.1 σ)
- stdlib task-clock 1% (214.0 σ)
- workspaceSymbols task-clock 4% (12.3 σ)
- workspaceSymbols wall-clock 4% (12.4 σ) |
Instruction counts suggest these are random fluctuations. Which seem to have become more frequent recently. |
!bench |
Here are the benchmark results for commit 2ee1eb9. |
Comparison with previous benchmark: http://speedcenter.informatik.kit.edu/velcom/compare/6b556c5e-941a-48e3-8f57-5457ee362ab8/to/30d3b0d6-b0c2-411e-af98-c57c0f36db58 +14% parsing, though variance is high |
!bench |
Here are the benchmark results for commit 17dd678. Benchmark Metric Change
=====================================================
- stdlib compilation new 2% (54.4 σ)
- stdlib task-clock 2% (208.5 σ)
- workspaceSymbols task-clock 3% (10.0 σ) |
+71% parsing compared to previous run http://speedcenter.informatik.kit.edu/velcom/compare/30d3b0d6-b0c2-411e-af98-c57c0f36db58/to/33767806-2bc2-4029-ad5f-f09a55692675 |
!bench |
Here are the benchmark results for commit a74b707. Benchmark Metric Change
========================================
- liasolver task-clock 1% (10.8 σ)
- liasolver wall-clock 1% (11.0 σ)
- stdlib task-clock 2% (99.1 σ) |
468b341
to
915bd1e
Compare
!bench |
Here are the benchmark results for commit 915bd1e. |
We better hope the `leading_parser`s are closed terms
…ken table divergence
…ext constructor The context is now manipulated using `adaptCacheableContext` and `adaptUncacheableContext` and created using `ParserFn.run`.
!bench |
Here are the benchmark results for commit d0f2fe4. Benchmark Metric Change
=========================================
+ stdlib task-clock -2% (-32.2 σ)
+ stdlib wall-clock -2% (-68.0 σ) |
compiler.ir.result reports 0 allocations on happy path
As this excludes trailing parsers from being cached, we also reset `lhsPrec`, which is not read but set by leading parsers, to 0 | ||
in order to increase cache hits. Finally, `errorMsg` is also reset to `none` as a leading parser should not be called in the first | ||
place if there was an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable? Test suite says "yes". All ParserState
fields are accounted for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. It is great you are documenting it.
Cache invocations of category,
leading_parser
andsyntax :=
parsers using a mapping from parser name and current context & state to parse result. Abstract parser context and syntax stack to enforce correct use.