[go: nahoru, domu]

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

optimization use small blocks up to 64KB #17107

Merged
merged 4 commits into from
May 1, 2023

Conversation

klauspost
Copy link
Contributor

Description

From #17103 - files up to 1MB would be read in 32KB blocks. Set that threshold to 64KB, so at most there are 2 reads.

Remove the unneeded wrapper in readAllData when we are not using O_DIRECT - we are reading directly into a single buffer, so there is no need for an intermediate buffer. This will save a memcopy in most cases.

Either way, we now quickly reject on unsupported platforms and avoid the copying there.

Bonus: ReadFileWithFileInfo will now also use NO_ATIME flag for reads.

How to test this PR?

Picked up by regular tests reliably.

Types of changes

  • Optimization (provides speedup with no functional changes)

From minio#17103 - files up to 1MB would be read in 32KB blocks. Set that threshold to 64KB, so at most there are 2 reads.

Remove the unneeded wrapper in readAllData when we are not using O_DIRECT - we are reading directly into a single buffer, so there is no need for an intermediate buffer. This will save a memcopy in most cases.

Either way, we now quickly reject on unsupported platforms and avoid the copying there.
@harshavardhana harshavardhana changed the title Use small blocks up to 64KB optimization use small blocks up to 64KB May 1, 2023
@harshavardhana harshavardhana merged commit e8c0a50 into minio:master May 1, 2023
@tdsn0007
Copy link
tdsn0007 commented May 3, 2023

Hi, this optimization will help to read 1MB files (like veeam files)?

@klauspost klauspost deleted the use-32k-blocks-up-to-64k branch May 4, 2023 07:48
@klauspost
Copy link
Contributor Author

@tdsn0007 A tiny bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants