-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Speed up test_urlsplit_normalization #26688
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 test_urlsplit_normalization #26688
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@serhiy-storchaka
I think that this PR is worth to review :) Can you please take a look?
This PR is stale because it has been open for 30 days with no activity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Speed up test_urlsplit_normalization (pythonGH-26688)
Thank you for your contribution @jacobtylerwalls. |
Noticed while working on #26687 that one of the tests in
test_urlparse
took ~7s. Here I've short-circuited the filtering of a massive list comprehension (sys.maxunicode
for me is 1,114,111) by checking if not empty before running split(), set(), &, etc.LMK if this needs a ticket.
$ ./python.exe -m unittest test.test_urlparse.UrlParseTestCase.test_urlsplit_normalization
Before
Ran 1 test in 6.981s
After
Ran 1 test in 2.459s