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

Avoid expensive regular expressions for NON_PRINTABLE check #124

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on May 22, 2019

  1. Avoid expensive regular expressions

    The NON_PRINTABLE regex is initialized at module import time and takes
    significant time to build, especially with the later Unicode versions
    and code points beyond 0xFFFF.
    
    Instead, use the unicodedata module to query the character category
    and filter for control characters. Apart from avoiding the complex regex
    machinery, this is also forward compatible to future Unicode revisions.
    roehling committed May 22, 2019
    Configuration menu
    Copy the full SHA
    f527a46 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2019

  1. Optimize evaluation order

    For the common case, the loop is about twice as fast now.
    roehling committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    ccda847 View commit details
    Browse the repository at this point in the history