[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

Fix SkipReader performance with small initial read #20030

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

klauspost
Copy link
Contributor
@klauspost klauspost commented Jul 2, 2024

Description

If SkipReader is called with a small initial buffer it may be doing a huge number if Reads to skip the requested number of bytes. If a small buffer is provided grab a 32K buffer and use that. May only be a practical issue in tests - cannot tell.

Fixes slow execution of testAPIGetObjectWithMPHandler.

Bonuses:

  • Use -short with -race test.
  • Do all suite test types with -short.
  • Enable compressed+encrypted in testAPIGetObjectWithMPHandler.
  • Disable big file tests in testAPIGetObjectWithMPHandler when using -short.

How to test this PR?

Run tests.

Types of changes

  • Optimization (provides speedup with no functional changes)
  • Unit tests added/updated

If `SkipReader` is called with a small initial buffer it may be doing a huge number if Reads to skip the requested number of bytes. If a small buffer is provided grab a 32K buffer and use that.

Fixes slow execution of `testAPIGetObjectWithMPHandler`.

Bonuses:

* Use `-short` with `-race` test.
* Do all suite test types with `-short`.
* Enable compressed+encrypted in `testAPIGetObjectWithMPHandler`.
* Disable big file tests in `testAPIGetObjectWithMPHandler` when using `-short`.
@klauspost klauspost changed the title Fix SkipReader with small initial read Fix SkipReader performance with small initial read Jul 2, 2024
@harshavardhana harshavardhana merged commit 2040559 into minio:master Jul 2, 2024
20 checks passed
@klauspost klauspost deleted the fix-skipreader-first-read branch July 2, 2024 16:18
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

Successfully merging this pull request may close these issues.

None yet

3 participants