Reduce Result<Tok, LexicalError> size by using Box<str> instead of String - #9885
Merged
Conversation
CodSpeed Performance ReportMerging #9885 will not alter performanceComparing Summary
|
MichaReiser
force-pushed
the
lexer-perf
branch
from
February 7, 2024 22:36
6a2377f to
752ad62
Compare
MichaReiser
force-pushed
the
reduce-tok-size
branch
3 times, most recently
from
February 7, 2024 22:43
534fa8a to
6b0a6a1
Compare
MichaReiser
force-pushed
the
lexer-perf
branch
from
February 7, 2024 22:50
752ad62 to
632a347
Compare
MichaReiser
force-pushed
the
reduce-tok-size
branch
from
February 7, 2024 22:51
6b0a6a1 to
da6e993
Compare
MichaReiser
force-pushed
the
lexer-perf
branch
from
February 7, 2024 22:58
632a347 to
1ec90fb
Compare
MichaReiser
force-pushed
the
reduce-tok-size
branch
from
February 7, 2024 23:12
da6e993 to
20ae19c
Compare
Contributor
|
MichaReiser
force-pushed
the
reduce-tok-size
branch
3 times, most recently
from
February 8, 2024 03:07
4c7142b to
e232f73
Compare
Tok size by using Box<str> instead of StringTok and Result<Tok, LexicalError> sizes by using Box<str> instead of String
Tok and Result<Tok, LexicalError> sizes by using Box<str> instead of StringResult<Tok, LexicalError> size by using Box<str> instead of String
BurntSushi
reviewed
Feb 8, 2024
Member
|
I'm not kidding I was thinking about this as I fell asleep a few nights ago. |
MichaReiser
force-pushed
the
reduce-tok-size
branch
from
February 8, 2024 18:52
e232f73 to
b06b469
Compare
MichaReiser
marked this pull request as ready for review
February 8, 2024 18:54
MichaReiser
force-pushed
the
reduce-tok-size
branch
from
February 8, 2024 19:01
b06b469 to
7a7f01c
Compare
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.
LexicalErrortype by usingBox<str>overStringToksize by usingBox<str>overString.Using
Box<str>is sufficient for us because we don't want to mutate the error message or token value.The downside of this is that using
Box<str>is slightly more annoying.Future: It would be interesting to change the Lexer signature always to return a
Tok::Invalidand write the errors to aVecinstead. This should allow for drastically reducing the size ofTokandSpanned.