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

perf: url encode path segments in longer string slices #1026

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

Conversation

dsherret
Copy link
Contributor

@dsherret dsherret commented Feb 7, 2025

Before:

test long           ... bench:         250 ns/iter (+/- 11) = 172 MB/s

After:

test long           ... bench:         221 ns/iter (+/- 24) = 248 MB/s

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 68.18182% with 14 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@79ff014). Learn more about missing BASE report.

Files with missing lines Patch % Lines
url/src/parser.rs 68.18% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1026   +/-   ##
=======================================
  Coverage        ?   79.93%           
=======================================
  Files           ?       24           
  Lines           ?     4322           
  Branches        ?        0           
=======================================
  Hits            ?     3455           
  Misses          ?      867           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1305,7 +1367,7 @@ impl<'a> Parser<'a> {
}
}
if scheme_type.is_file() {
// while urls path’s size is greater than 1
// while url's path’s size is greater than 1
// and url’s path[0] is the empty string,

Choose a reason for hiding this comment

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

Missed a `

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. I missed reverting that after I noticed that kind of quote is used everywhere in the codebase (habit I have because in Deno, we avoid using non-ascii characters in JS because it causes the source code to be stored less efficiently. Example: microsoft/TypeScript#53608). Thanks!

@Scripter17
Copy link

It fully occurred to me how annoying it must be to get a "you missed a smudge" review from a rando on your genuinely very impressive work so I want to redeem myself: You're awesome

URL parsing has been a bit of a bottleneck in my current main project for a while and all your work does a pretty good dent in it

Seeing all your pull requests was a very nice thing to wake up and look forward to

Signed-off-by: David Sherret <[email protected]>
@dsherret
Copy link
Contributor Author

dsherret commented Feb 8, 2025

Not annoying. Thanks!

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.

2 participants