Commit 8caff2a
committed
perf(core): Warm up all metrics worker threads to eliminate lazy init delays
Revert the half-thread warmup optimization and warm up all worker
threads during pool initialization. While half-warmup reduced CPU
contention during the security check phase, it left workers cold for
the metrics phase. Cold workers need ~150ms to lazy-load gpt-tokenizer,
during which they cannot process batches, effectively serializing
early metrics work onto fewer threads.
Full warmup slightly increases contention during the pipeline overlap
phase, but the I/O-bound file collection and git subprocess stages
provide natural CPU headroom that absorbs the extra warmup load.
Benchmark results (repomix on itself, 996 files, 10 runs each):
Before (half warmup): median 1.599s
After (full warmup): median 1.540s
Improvement: ~59ms (~3.7%)
vs main branch: median 1.764s → 1.540s (~12.7% total improvement)
https://claude.ai/code/session_018NjNHi6fb1AiQHbWdarYcW1 parent ce4a7e5 commit 8caff2a
2 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | | - | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | 131 | | |
133 | 132 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
0 commit comments