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

Wrap cache reader in BufReader for speed. #166

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

hoytak
Copy link
Collaborator

@hoytak hoytak commented Feb 5, 2025

Profiling reading from the cache in the download of a 1GB file showed that 48% of the time was spent in system read calls. This PR removes that bottleneck by simply wrapping the read calls in a BufReader. This eliminates that bottleneck and showed a 15-20% overall speed improvement restoring the 1GB file from cache (based on a few non-rigorous bash time runs).

@hoytak hoytak requested a review from assafvayner February 5, 2025 21:00
@hoytak hoytak merged commit 169c368 into main Feb 6, 2025
2 checks passed
@hoytak hoytak deleted the hoytak/250205-bufreader-cache-improvement branch February 6, 2025 00:48
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.

2 participants