Skip to content
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

Adding buffer size to sourceHandleRange #213

Merged
merged 1 commit into from May 12, 2015
Merged

Conversation

@nhibberd
Copy link
Contributor

nhibberd commented May 12, 2015

We're reading from disk and uploading parts of files using http-conduit and we've observed that the buffer size has significant impact on performance. On certain machines going from a 4k buffer to a 1mb buffer results in a 4x speed up.

Not 100% on the signature that you would prefer, this lets us achieve what we need. If you would like it in a slightly different form just let me know.

@@ -181,7 +182,20 @@ sourceHandleRange :: MonadIO m
-> Maybe Integer -- ^ Offset
-> Maybe Integer -- ^ Maximum count
-> Producer m S.ByteString
sourceHandleRange handle offset count = do
sourceHandleRange handle offset count =
sourceHandleRangeWithBuffer handle offset count 4096

This comment has been minimized.

Copy link
@snoyberg

snoyberg May 12, 2015

Owner

Ouch, having the buffer size so low in the first place was a big mistake. I'll fix that also.

snoyberg added a commit that referenced this pull request May 12, 2015
Adding buffer size to sourceHandleRange
@snoyberg snoyberg merged commit 2dfa09f into snoyberg:master May 12, 2015
@snoyberg

This comment has been minimized.

Copy link
Owner

snoyberg commented May 12, 2015

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.