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

Process "multi" strings in compiled regexes 4 or 2 chars at a time when possible #1654

Merged
merged 5 commits into from
Jan 14, 2020

Commits on Jan 13, 2020

  1. Process "multi" strings in compiled regexes 4 or 2 chars at a time wh…

    …en possible
    
    When we encounter a series of characters in a regex pattern, we emit a comparison check per character.  This updates that codegen to compare 2 or 4 characters at a time, when possible.  In general these sequences are not long, but they can easily be a handful of characters, and comparing with ints and longs instead of chars slightly improves both throughput and the size of the IL and JIT'd asm.
    stephentoub committed Jan 13, 2020
    Configuration menu
    Copy the full SHA
    2ab0dbc View commit details
    Browse the repository at this point in the history
  2. Address PR feedback

    And add a test.
    stephentoub committed Jan 13, 2020
    Configuration menu
    Copy the full SHA
    74c00da View commit details
    Browse the repository at this point in the history
  3. Use StartsWith for long strings in EmitMultiChar

    Avoids potentially very long generated Go methods and the resulting long JIT times and potentially stack overflows at invocation time.  Prior to this change, a test added for 100K-long string takes a very long time to run and then stack overflows, whereas with this change it's very fast.
    stephentoub committed Jan 13, 2020
    Configuration menu
    Copy the full SHA
    7af70b0 View commit details
    Browse the repository at this point in the history
  4. Address PR feedback

    stephentoub committed Jan 13, 2020
    Configuration menu
    Copy the full SHA
    155135a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    360c9c8 View commit details
    Browse the repository at this point in the history