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

Replace urlparse() with the faster urlsplit() alternative #3286

Merged
merged 1 commit into from Apr 13, 2023

Conversation

ivarnakken
Copy link
Member

urlparse() allows for “parameters” before the ? in the URL, which we do not use here.

urlsplit() supports a later (1998) RFC and does not parse such parameters. It's thus a bit faster.

Anthony Sottile did a video on the subject, which taught me about this difference.


This change makes a very little difference for us, but I just wanted to try it out for fun.

@ivarnakken ivarnakken added enhancement Pull requests that make or issues that suggest enhancements, instead of just purely new features review-needed Pull requests that need review small-fix Pull requests that fix something small labels Apr 13, 2023
@ivarnakken ivarnakken self-assigned this Apr 13, 2023
@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f19caaf) 88.32% compared to head (e5865ab) 88.32%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3286   +/-   ##
=======================================
  Coverage   88.32%   88.32%           
=======================================
  Files         661      661           
  Lines       20882    20882           
=======================================
  Hits        18444    18444           
  Misses       2438     2438           
Impacted Files Coverage Δ
lego/apps/ical/utils.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@LudvigHz LudvigHz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@ivarnakken ivarnakken added approved Pull requests that have been approved ready-to-merge Pull requests that have been approved and are ready to be merged and removed review-needed Pull requests that need review labels Apr 13, 2023
@ivarnakken ivarnakken merged commit 9a662c1 into master Apr 13, 2023
3 checks passed
@ivarnakken ivarnakken deleted the replace-urlparse-with-urlsplit branch April 13, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Pull requests that have been approved enhancement Pull requests that make or issues that suggest enhancements, instead of just purely new features ready-to-merge Pull requests that have been approved and are ready to be merged small-fix Pull requests that fix something small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants