Skip to content

Conversation

@vtjnash
Copy link
Contributor

@vtjnash vtjnash commented Feb 2, 2024

Each of these 3 changes gives roughly a 2x speedup for me, taking it from 1.6s to 0.4s, vs. BufferedStreams timing of 0.3s vs. IOBuffer timing of 0.15s

Fixes #150

FWIW, reading a larger chunk at a time into a buffer is usually going to be much much faster again, since it can benefit from vectorized copies at each step, but that doesn't mean we cannot attempt to microoptimize some IO functions

Reloading the Buffer from mutable State is very slow, so make a
copy in the immutable struct where it is not expensive.

Additionally refactor eof into a fast and slow path, so that the fast
path is inlined.
Copy link
Member

@nhz2 nhz2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ideas to improve speed

3 participants