-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use memrchr or similar in LineWriter::write #30076
Comments
fhahn
added a commit
to fhahn/rust
that referenced
this issue
Dec 1, 2015
fhahn
added a commit
to fhahn/rust
that referenced
this issue
Dec 1, 2015
bluss
changed the title
Use memchr or similar in LineWriter::write
Use memrchr or similar in LineWriter::write
Dec 2, 2015
Of course memrchr, I did in fact miss the position vs rposition difference on first reading. |
Merged
bors
added a commit
that referenced
this issue
Dec 19, 2015
This PR adds `memchr`and `memrchr` based on @BurntSushi 's rust-memchr crate to libstd (as discussed in #30151). I've update some places in libstd to use memchr/memrchr, but I am not sure if there are other places where it could be used as well. ref #30076
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The LineWriter (used by stdout) searches for a newline in each
.write()
call. As compiled today, this byte search compiles to a byte-by-byte loop. This is a very hot loop, and unnecessarily so if you output data that's not line delimited. Using memchr or equivalent would improve this.The text was updated successfully, but these errors were encountered: