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 improvements to FileStorage #24

Open
ArnauPrat opened this issue Sep 21, 2018 · 0 comments
Open

Possible improvements to FileStorage #24

ArnauPrat opened this issue Sep 21, 2018 · 0 comments

Comments

@ArnauPrat
Copy link
Contributor

  • Evaluate the use of different file reading apis: iostreams, fread or SO dependant read. iostreams and fread are buffered, which means that data (more data than that requested) is copied into an intermediate buffer, just in case successive calls to fread need that data. This is intended to speed up the case of reading small portions of data sequentially. This is not our case, where we read chunks of page size, typically 64KB, so we are paying an extra cost here when copying into the intermediate buffer

  • Disk access coalescing: This is more complicated to implement, but tries to solve the following problem. When multiple threads request for pages, (for instance, in a parallel scan), the order at which these threads make the page requests can be not sequential. For instance, eventhough we might be conceptually scanning the pages in order (e.g. 0,1,2,3...) the threads could reach the file storage system in a different order, which would translate into a page access sequence like 1,4,2,3,7,6 .... This basically destroys the performance. Thus for this optimization the file storage could be more like a service, where a single and independent thread processes de read requests with high priority, with a queue of pending requests. Before reading the next page, it could inspect such queue and coalesce the accesses. For instance, if the queue contained 4,2,3,6, it could read a full chunck from 2 to 6 in a single call.

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

1 participant