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

Speed up parsing with table-driven predicates. #276

Merged
merged 1 commit into from
Sep 2, 2020

Commits on Aug 31, 2020

  1. Speed up parsing with table-driven predicates.

    When loading a capture in wrench, startup time is dominated by RON
    parsing, and most of that time is spent in simple byte predicates such
    as "is this a whitespace byte?"
    
    These predicates currently use `slice::contains` to search through a
    list of possible matching bytes. The list lengths range from 4 to 63.
    
    This commit changes these predicates to use a table. Each predicate is
    now just an array lookup plus a bit mask. This more than doubles the
    parsing speed for the wrench capture I have been looking at.
    nnethercote committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    27d6989 View commit details
    Browse the repository at this point in the history