You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one didn't have a `SAFETY` comment; looking through
git log here I do see:
> It no longer does internal buffer allocations when reading tar headers, saving
> another ~10% off the total time to print a merged dumpfile.
However, it looks like that was going from allocation-per-read
to "read into a global buffer", which we're still doing here.
I didn't measure performance here, but I think
we have other performance worries and it's not worth
carrying an `unsafe` for this.
In very hot I/O paths one *can* measure the impact of
zero-initializing, but I'm doubtful of that here.
Just looking at the bigger picture here I think
instead of a generic `R: Read` we should take
a `BufReader` and then use `fill_buf` on it,
which is intended for this use case.
Anyways for now just drop the `unsafe`.
Also add tests.
Signed-off-by: Colin Walters <[email protected]>
0 commit comments