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

Consider removing the file size check on mmap as it is redundant in most cases #106

Open
yhyu13 opened this issue Feb 29, 2024 · 0 comments

Comments

@yhyu13
Copy link

yhyu13 commented Feb 29, 2024

Hi,

I believe it's quite redundant for mmap for check file boundaries as in most use cases, mmap offset and length is bounded by user already.

It should totally up to the user to make sure boundary is met.

So the below query file size can be removed.

const auto file_size = detail::query_file_size(handle, error);

I am working a request that open a gigabytes file in read only mode into thousands of small fragments (~4MB each) , if using mio, it would query the file size thousands of times for nothing.

The boost v1.83.0 mapped_region (which does similar thing to mio) has skipped file size check and simply mapped the file

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