-
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
Badly optimized small bytes array search #75659
Labels
I-slow
Issue: Problems and improvements with respect to performance of generated code.
Comments
LeSeulArtichaut
added
the
I-slow
Issue: Problems and improvements with respect to performance of generated code.
label
Aug 18, 2020
I think that's because for we use rust-implemented memchr: rust/library/core/src/slice/mod.rs Lines 6739 to 6768 in 01ffbcb
While clang has built-in memchr: https://clang.llvm.org/docs/LanguageExtensions.html#string-builtins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When T is u16, u32, u64 or u128 the generated code is reasonable, like for u32 (rustc 1.47.0-nightly 7e6d6e5 2020-08-16, using -C opt-level=3 and more):
But when T is u8 or i8 it looks sub-optional for small arrays, because for such tiny arrays the overhead of calling another functions is bad:
The text was updated successfully, but these errors were encountered: