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

Possible unnecessary data copying from remotefile/blobfile #20

Open
cmdcolin opened this issue Jun 1, 2019 · 4 comments
Open

Possible unnecessary data copying from remotefile/blobfile #20

cmdcolin opened this issue Jun 1, 2019 · 4 comments

Comments

@cmdcolin
Copy link
Collaborator

cmdcolin commented Jun 1, 2019

The interface requires pre-allocation of a buffer and then copies results from something like a fetch which can involve large amounts of data. If there is some way to fix this it would be desirable

CC @jrobinso

@rbuels
Copy link
Contributor

rbuels commented Oct 2, 2019

Based on discussion just now, we are proposing adding an allocAndRead method with an API that does not take a passed-in buffer. Draft signature:

Promise<buffer> allocAndRead(offset, length, position)

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Oct 2, 2019

Likely offset will not be implemented. Offset is rarely used anyways, it is the "offset into the pre-allocated buffer that you write the returned data into"

@rbuels
Copy link
Contributor

rbuels commented Oct 2, 2019

Oh right.

so that would be
Promise<buffer> allocAndRead(length, position)

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Oct 2, 2019

Yap

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

No branches or pull requests

2 participants