-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Test utf8 validaiton based on rust-isutf8 #68463
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
cc @yoshuawuyts |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 707a653 with merge c93d8c28b4e86aee203bca6ba8f4d7ecb2045c0d... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@@ -1484,19 +1485,452 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> { | |||
#[allow(deprecated)] | |||
impl FusedIterator for LinesAny<'_> {} | |||
|
|||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] | |||
mod avx2 { |
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.
Shouldn't this specify a bunch of target features? If you don't do so it generates MUCH worse code (and maybe it doesn't even work, not sure).
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.
@CryZe good catch, I updated it the guard to use target_feature = "avx2"
that should solve this
@rust-timer build c93d8c28b4e86aee203bca6ba8f4d7ecb2045c0d Seems bors lost the try build finishing... |
Queued c93d8c28b4e86aee203bca6ba8f4d7ecb2045c0d with parent ae66171, future comparison URL. |
Finished benchmarking try commit c93d8c28b4e86aee203bca6ba8f4d7ecb2045c0d, comparison URL. |
Is that 44% slower? Can that be right? |
The code was without the AVX2 target feature guard, which has a heavy performance penalty. The timer needs to be rerun. |
Simply enabling AVX or changing CPU to |
Yes, iiuc you need to runtime select between the simd and non-simd versions. |
I don't quite follow the discussion. If we need another timer run, please say so explicitly :) |
What's interesting to me is how much of a negative impact worsened utf-8 validation seems to have. Like @Mark-Simulacrum postulated it indeed affects shorter programs more than longer ones (as evidenced by "hello world"). This makes it interesting to consider to what degree a positive change to the algorithm might speed up things.
|
@yoshuawuyts I don't think that commit is sufficient. rustc is not built with avx2 active (as would be the case with |
Is there no way to test it with |
I do not have the time to suggest a way to enable those compile time flags here (especially because our CI is not guaranteed to run on skylake). If you do not want to dig in, then I would propose that we close this. |
I don’t have any control about the benchmark system it’s not about want i can’t change that. |
DO NOT MERGE
This is a copy of @ArniDagur's rust-isutf8 port of Lemire's utf8 validation to use for validation to test the performance difference as suggested in #68455