Skip to content

reduce context switching by increasing buffer sizes#6

Merged
james-conn merged 1 commit intomainfrom
reduce-context-switching
Apr 4, 2026
Merged

reduce context switching by increasing buffer sizes#6
james-conn merged 1 commit intomainfrom
reduce-context-switching

Conversation

@james-conn
Copy link
Copy Markdown
Owner

When doing file IO in tokio, operations internally perform spawn_blocking which spins up a dedicated thread for each task. Increasing the buffer sizes reduces the overhead involved in context switching and managing these short-lived threads. This comes at the cost of increased memory usage, but results in significantly reduced wall clock time for large files.

@james-conn james-conn enabled auto-merge (squash) April 4, 2026 22:45
@james-conn james-conn disabled auto-merge April 4, 2026 22:45
@james-conn james-conn merged commit 07d64f1 into main Apr 4, 2026
8 checks passed
@james-conn james-conn deleted the reduce-context-switching branch April 4, 2026 22:45
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.

1 participant