-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: Add UrlPartsBuilder
#91871
rustdoc: Add UrlPartsBuilder
#91871
Conversation
r? @ollie27 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
948b8dc
to
273a626
Compare
Tests pass locally now. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 273a6269426722889715a79e5908570ca6993e34 with merge 24bb1f2a257c0c98879ec6d209134da5dffca55a... |
/// | ||
/// Basic usage: | ||
/// | ||
/// ```ignore (private-type) |
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.
Is there any way to run doctests for private code?
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.
Not that I know of...
This is a type for efficiently and easily constructing the part of a URL after the domain: `nightly/core/str/struct.Bytes.html`. It allows simplifying some code and avoiding some allocations in the `href_*` functions. It will also allow making `Cache.paths` et al. use `Symbol` without having to allocate `String`s in the `href_*` functions. `String`s would be necessary otherwise because `Symbol::as_str()` returns `SymbolStr`, whose `Deref<Target = str>` impl requires the `str` to not outlive it. This is the primary motivation for the addition of `UrlPartsBuilder`.
☀️ Try build successful - checks-actions |
Queued 24bb1f2a257c0c98879ec6d209134da5dffca55a with parent 1796de7, future comparison URL. |
273a626
to
4bac09f
Compare
Finished benchmarking commit (24bb1f2a257c0c98879ec6d209134da5dffca55a): comparison url. Summary: This change led to moderate relevant improvements 🎉 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
Instructions count improvements of up to -0.83%, including -0.74% on webrender and close to that on several other real-world crates! max-rss is a bit mixed, but overall looks like an improvement. The regressions seem to be mainly for artificial benchmarks rather than real-world code. |
Looks great, thanks! Just one nit to fix and it's good to go. r=me once updated. |
Thanks for the speedy review :) @bors r=GuillaumeGomez rollup=never |
📌 Commit 4bac09f has been approved by |
Is it still worth merging this given that #91948 doesn't need it? It's going to cause conflicts if it does merge. |
Yes, it is. It improves code quality and performance on its own. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (8f54061): comparison url. Summary: This change led to moderate relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
Changes reported in the summary comment are spurious rustc changes. Doc benchmarks show small improvements. |
Given the comment above and the additional concern about noise as a result of the issue tracked in rust-lang/rustc-perf#1126 I'm marking as triaged, not something we should address directly. @rustbot label +perf-regression-triaged |
This is a type for efficiently and easily constructing the part of a URL
after the domain:
nightly/core/str/struct.Bytes.html
.It allows simplifying some code and avoiding some allocations in the
href_*
functions.It will also allow making
Cache.paths
et al. useSymbol
withouthaving to allocate
String
s in thehref_*
functions.String
s wouldbe necessary otherwise because
Symbol::as_str()
returnsSymbolStr
,whose
Deref<Target = str>
impl requires thestr
to not outlive it.This is the primary motivation for the addition of
UrlPartsBuilder
.