perf: back Text by an array instead of List.Vector - #2
Open
jonaprieto wants to merge 4 commits into
Open
Conversation
Comment /bench on a PR to build and run the prim-parser and lean4-parser benchmarks and post a results table back as a sticky comment. Restricted to commenters with push access.
Replace the `List.Vector Char n` input with an array-backed `Text` (array + offset + length invariant), decoded from a String in a single pass via `@[implemented_by]`. `anyChar` now indexes the array instead of matching a cons cell, avoiding the O(n) list construction that dominated large inputs.
Owner
Author
|
/bench |
Benchmark resultsPR
|
Owner
Author
|
/bench |
1 similar comment
Owner
Author
|
/bench |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is just an experiment to run the benchs. For example on could rework the
Textto see what's the impact. Say input fromList.Vector Char nto an array-backed structure with a single-pass decoder, so parsing no longer pays for O(n) list construction on large inputs. Comment /bench to see the impact vs base.