-
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
Implement bufwriter_raw_buffer feature #79921
Conversation
r? @shepmaster (rust-highfive has picked a reviewer for you, use r? to override) |
I'll have a write-up for this in a few. |
I've encountered some performance issues with The performance issue came up in a change I'm working on that uses The change makes a lot of small writes to Very definitely not faster, so I made some trivial changes to Obviously, this is enormously better, but it still wasn't satisfying (well, it was very satisfying to improve Better...closer...warmer. I can work with it anyway. Here is the raw buffer API vs the optimized BufWriter's existing API. While the percentage differences seem small, remember that this is the performance difference for the entire compilation of these crates, not the So what is it about the existing API that accounts for the performance difference? Well, one case in which a difference arises is when you have static knowledge about the input and
This was the use case I had for a raw buffer API, but there may be other cases where a client can do better with it. What do people think about adding this? @rustbot label T-libs |
r? @sfackler |
This seems like a strange API to expose from BufWriter, and whatever you're trying to do in rustc may be better served by a custom type. |
@sfackler, that's the path I've taken in #80463, and I'm totally fine with it personally. FWIW, the benefit of being able to use |
Once the |
Thanks @sfackler. Closing this and the tracking issue. |
Tracking issue: #79916