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

Use Python built-in str.lower in preference to asciiUpper2Lower character table translation #526

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

Conversation

jayaddison
Copy link
Contributor

@jayaddison jayaddison commented Jan 9, 2021

This change uses Python's builtin str.lower to perform string lowercasing (typically used during case-insensitive element/attribute name comparison), and provides a nice small parsing performance benefit on Python (cpython 3.9.1).

Benchmark command used: python benchmarks/bench_html.py parse --rigorous

Before

.........................................
html_parse_etree: Mean +- std dev: 208 ms +- 14 ms

After

.........................................
html_parse_etree: Mean +- std dev: 200 ms +- 12 ms

This follows on from some conversation in #520 regarding comparison operations and lowercasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant