Skip to content
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

Peeking lexer optimizations #263

Merged
merged 4 commits into from
Dec 3, 2022

Commits on Nov 16, 2022

  1. 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.
    Peter Dolak authored and petee-d committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    96bc359 View commit details
    Browse the repository at this point in the history
  2. 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.
    Peter Dolak authored and petee-d committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    d5ff087 View commit details
    Browse the repository at this point in the history
  3. Optimize PeekingLexer to provide constant-time Peek

    The attached Benchmark is over 3x faster after the optimization
    Peter Dolak authored and petee-d committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    9cc5ac6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e90a87f View commit details
    Browse the repository at this point in the history