Skip to content

fix(file): fix read performance regression from RangeReader change#938

Open
maggch97 wants to merge 1 commit intofclairamb:mainfrom
maggch97:fix/read-performance-regression
Open

fix(file): fix read performance regression from RangeReader change#938
maggch97 wants to merge 1 commit intofclairamb:mainfrom
maggch97:fix/read-performance-regression

Conversation

@maggch97
Copy link
Copy Markdown

The RangeReader commit (#922) changed Read() to request only len(p) bytes per call instead of streaming from offset to end-of-file. This caused every Read() call to open a new HTTP connection to S3, resulting in hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB file with 32KB buffers instead of 1).

Fix by requesting from current offset to end-of-file when opening a read stream, and properly closing the stream on Seek() so the next Read() opens a new stream from the correct position.

The RangeReader commit (fclairamb#922) changed Read() to request only len(p)
bytes per call instead of streaming from offset to end-of-file. This
caused every Read() call to open a new HTTP connection to S3, resulting
in hundreds of requests for sequential reads (e.g. ~320 requests for
a 10MB file with 32KB buffers instead of 1).

Fix by requesting from current offset to end-of-file when opening a
read stream, and properly closing the stream on Seek() so the next
Read() opens a new stream from the correct position.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maggch97 added a commit to maggch97/vikunja that referenced this pull request Feb 27, 2026
The upstream afero-s3 library has a severe performance regression where
every Read() call opens a new HTTP connection to S3, resulting in
hundreds of requests for sequential reads (e.g. ~320 requests for a
10MB file with 32KB buffers instead of 1).

This temporarily replaces afero-s3 with a fork that fixes the issue by
requesting from the current offset to end-of-file when opening a read
stream, and properly closing the stream on Seek().

Upstream PR: fclairamb/afero-s3#938
This replace directive should be removed once the upstream PR is merged
and a new version is released.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kolaente pushed a commit to go-vikunja/vikunja that referenced this pull request Mar 3, 2026
…2313)

The upstream afero-s3 library has a severe performance regression where
every Read() call opens a new HTTP connection to S3, resulting in
hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB
file with 32KB buffers instead of 1).

This temporarily replaces afero-s3 with a fork that fixes the issue by
requesting from the current offset to end-of-file when opening a read
stream, and properly closing the stream on Seek().

Upstream PR: fclairamb/afero-s3#938 This replace
directive should be removed once the upstream PR is merged and a new
version is released.
tink-bot pushed a commit to go-vikunja/vikunja that referenced this pull request Mar 26, 2026
…2313)

The upstream afero-s3 library has a severe performance regression where
every Read() call opens a new HTTP connection to S3, resulting in
hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB
file with 32KB buffers instead of 1).

This temporarily replaces afero-s3 with a fork that fixes the issue by
requesting from the current offset to end-of-file when opening a read
stream, and properly closing the stream on Seek().

Upstream PR: fclairamb/afero-s3#938 This replace
directive should be removed once the upstream PR is merged and a new
version is released.
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.

1 participant