Uh oh!
There was an error while loading. Please reload this page.
Optimize Wtf8Buf::into_string for the case where it contains UTF-8. - #96869
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sunfishcode
commented
May 11, 2022
r? rust-lang/libs |
joshtriplett
commented
May 17, 2022
@bors r+ rollup=never |
bors
commented
May 17, 2022
📌 Commit f4c93bcbe837ab5220beaa2892fc249f49a9e740 has been approved by |
bors
commented
May 17, 2022
⌛ Testing commit f4c93bcbe837ab5220beaa2892fc249f49a9e740 with merge 7f13587a59ff3c5350b77bf9334994f91f05d9fc... |
bors
commented
May 17, 2022
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
sunfishcode
commented
May 18, 2022
src/librustdoc/html/render/context.rs had an assert that rustdoc's render context was a certain size. It's already not checked on most platforms, as it's just a guard against the context growing unexpectedly, so I've now added a patch to disable the check on Windows too. |
bors
commented
May 28, 2022
☔ The latest upstream changes (presumably #97433) made this pull request unmergeable. Please resolve the merge conflicts. |
crlf0710
commented
May 28, 2022
There's merge conflict now. Needs a rebase. |
sunfishcode
commented
May 31, 2022
sunfishcode
commented
May 31, 2022
@rustbot label -S-waiting-on-author +S-waiting-on-review |
joshtriplett
commented
Jun 23, 2022
@bors r+ |
bors
commented
Jun 23, 2022
📌 Commit e620b42644e3404377fa0fae0afd660c6bd77999 has been approved by |
bors
commented
Jun 23, 2022
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
klensy
commented
Jun 23, 2022
Merge branch 'master' into main |
sunfishcode
commented
Jun 23, 2022
I think I used the github merge-conflict UI and didn't realize that generated a merge commit. I've now fixed that. |
sunfishcode
commented
Aug 23, 2022
Ping @joshtriplett; this is already |
jyn514
commented
Aug 23, 2022
@bors r=joshtriplett |
bors
commented
Aug 23, 2022
bors
commented
Aug 24, 2022
bors
commented
Aug 24, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Aug 24, 2022
Finished benchmarking commit (25ea5a3): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
| /// It is possible for `bytes` to have valid UTF-8 without this being | ||
| /// set, such as when we're concatenating `&Wtf8`'s and surrogates become | ||
| /// paired, as we don't bother to rescan the entire string. | ||
| is_known_utf8: bool, |
There was a problem hiding this comment.
Adding a field here introduced a subtle bug in PathBuf: #124409.
Privacy-breaking transmutes are "fun". ;)
…ng-utf8-invariant, r=<try> Make PathBuf less Ok with adding UTF-16 then `into_string` Fixesrust-lang#126291 which is, as far as I can tell, a regression introduced by rust-lang#96869. try-job: x86_64-msvc
…ring-utf8-invariant, r=joboet Make PathBuf less Ok with adding UTF-16 then `into_string` Fixesrust-lang#126291 which is, as far as I can tell, a regression introduced by rust-lang#96869. try-job: x86_64-msvc
Rollup merge of rust-lang#126305 - workingjubilee:fix-os-string-to-string-utf8-invariant, r=joboet Make PathBuf less Ok with adding UTF-16 then `into_string` Fixesrust-lang#126291 which is, as far as I can tell, a regression introduced by rust-lang#96869. try-job: x86_64-msvc
…isDenton Add UTF-8 validation fast paths in `Wtf8Buf` This adds two more fast paths for UTF-8 validation in `Wtf8Buf`, making use of the `is_known_utf8` flag added in rust-lang#96869 (Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8). r? `@ChrisDenton`
Rollup merge of rust-lang#137154 - thaliaarchi:wtf8-fast-paths, r=ChrisDenton Add UTF-8 validation fast paths in `Wtf8Buf` This adds two more fast paths for UTF-8 validation in `Wtf8Buf`, making use of the `is_known_utf8` flag added in rust-lang#96869 (Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8). r? `@ChrisDenton`
…isDenton Add UTF-8 validation fast paths in `Wtf8Buf` This adds two more fast paths for UTF-8 validation in `Wtf8Buf`, making use of the `is_known_utf8` flag added in rust-lang#96869 (Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8). r? `@ChrisDenton`
…isDenton Add UTF-8 validation fast paths in `Wtf8Buf` This adds two more fast paths for UTF-8 validation in `Wtf8Buf`, making use of the `is_known_utf8` flag added in rust-lang#96869 (Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8). r? `@ChrisDenton`
Add a
is_known_utf8flag toWtf8Buf, which tracks whether thestring is known to contain UTF-8. This is efficiently computed in many
common situations, such as when a
Wtf8Bufis constructed from aStringor
&str, or withWtf8Buf::from_widewhich is already doing UTF-16decoding and already checking for surrogates.
This makes
OsString::into_stringO(1) rather than O(N) on Windows incommon cases.
And, it eliminates the need to scan through the string for surrogates in
Args::nextandVars::next, because the strings are already beingtranslated with
Wtf8Buf::from_wide.Many things on Windows construct
OsStrings withWtf8Buf::from_wide,such as
DirEntry::file_nameandfs::read_link, so with this patch,users of those functions can subsequently call
.into_string()withoutpaying for an extra scan through the string for surrogates.
r? @ghost