Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
jayaddison wants to merge2 commits intohtml5lib:masterfromjayaddison:casing/use-builtin-str-lower
Closed

Conversation

jayaddison
Copy link
Contributor

This change uses Python's builtinstr.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 someconversation in #520 regarding comparison operations and lowercasing.

@jayaddison
Copy link
ContributorAuthor

Cleaning up some old / stale pull requests; please let me know if this changeset is considered worthwhile and I'll reopen if so.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@jayaddison

[8]ページ先頭

©2009-2025 Movatter.jp