Repository navigation
client-side: run each compile on a current-thread runtime - #2997
Merged
sylvestre merged 1 commit intoNov 20, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #2997 +/- ##
==========================================
- Coverage 79.00% 72.39% -6.61%
==========================================
Files 75 75
Lines 46249 44746 -1503
==========================================
- Hits 36538 32395 -4143
- Misses 9711 12351 +2640 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ahochheiden
approved these changes
Nov 12, 2026
ahochheiden
left a comment
Member
There was a problem hiding this comment.
Looks good to me, just one small simplification.
Comment on lines
+1015
to
+1020
| let conn = connect_or_start_server(&get_addr(), startup_timeout)?; | ||
| if config.client_side_mode { | ||
| // Under make -jN each CLI process gets only 2 worker threads; | ||
| // one for preprocessing/compilation and one for IPC. The | ||
| // blocking thread pool absorbs zstd/zip work. | ||
| let mut runtime = Builder::new_multi_thread() | ||
| .worker_threads(2) | ||
| .enable_all() | ||
| .build()?; | ||
| // One compile needs no worker threads of its own: starting two | ||
| // in every invocation cost about 1ms per cache hit. The | ||
| // blocking thread pool still absorbs zstd/zip work. | ||
| let mut runtime = new_client_runtime()?; |
Member
There was a problem hiding this comment.
I think we can move this outside the if and get rid of the same call on line 1035 below, since both branches build the same runtime now.
Suggested change
| let conn = connect_or_start_server(&get_addr(), startup_timeout)?; | |
| if config.client_side_mode { | |
| // Under make -jN each CLI process gets only 2 worker threads; | |
| // one for preprocessing/compilation and one for IPC. The | |
| // blocking thread pool absorbs zstd/zip work. | |
| let mut runtime = Builder::new_multi_thread() | |
| .worker_threads(2) | |
| .enable_all() | |
| .build()?; | |
| // One compile needs no worker threads of its own: starting two | |
| // in every invocation cost about 1ms per cache hit. The | |
| // blocking thread pool still absorbs zstd/zip work. | |
| let mut runtime = new_client_runtime()?; | |
| let conn = connect_or_start_server(&get_addr(), startup_timeout)?; | |
| let mut runtime = new_client_runtime()?; | |
| if config.client_side_mode { |
A client-side invocation built a multi-thread runtime with two workers, which it then mostly waited on: the compile runs in a child process and cache I/O goes over IPC. Starting those threads in every invocation made a cache hit 1.3ms slower (13.6ms to 12.3ms per hit, one at a time, for a file whose server-mode hit takes 8ms). Use the current-thread runtime server mode clients already use. Blocking work still goes to the blocking thread pool.
sylvestre
force-pushed
the
pr/client-current-thread-runtime
branch
from
November 20, 2026 08:41
476b5b5 to
37730ef
Compare
sylvestre
marked this pull request as ready for review
November 20, 2026 13:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A client-side invocation built a multi-thread Tokio runtime with two workers, which it then mostly waits on: the compile runs in a child process and cache I/O goes over IPC. Starting those threads in every invocation costs about 1.3ms per cache hit (13.6ms to 12.3ms, one hit at a time, on an FFmpeg source file whose server-mode hit takes 8ms).
Use the current-thread runtime that server-mode clients already use. Blocking work still goes to the blocking thread pool.