-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Provide PeekingLexer.Checkpoint as an allocation-free Clone alternative The state itself is still in private fields, thus Checkpoint being a public field doesn't break encapsulation. * Remove PeekingLexer.Clone and avoid an allocation when branching Roughly 5% less CPU time and 12% fewer allocations in the Thrift benchmark with generated lexer. * Optimize PeekingLexer to provide constant-time Peek The attached Benchmark is over 3x faster after the optimization * Add methods to create and restore PeekingLexer checkpoints
- Loading branch information
Showing
5 changed files
with
85 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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