Clear results when the thread count changes
Changing the thread count relabels the mt column headers immediately, so the
already-measured numbers would no longer match; drop them so the table never
shows stale results under a new thread count.
1 changed file+7−1
src/components/BenchmarkRunner.tsxmodified+7−1View file
@@ -179,7 +179,13 @@ export function BenchmarkRunner() {
179179 labelId="threads-label"
180180 label="threads (mt methods)"
181181 value={threads}
182- onChange={(e) => setThreads(Number(e.target.value))}
182+ onChange={(e) => {
183+ // The measured mt numbers no longer match the new thread count
184+ // (and the column headers would relabel), so drop stale results.
185+ setThreads(Number(e.target.value))
186+ setResults({})
187+ setProgress(0)
188+ }}
183189 >
184190 {THREAD_OPTIONS.map((t) => (
185191 <MenuItem key={t} value={t}>{t} thread{t > 1 ? 's' : ''}</MenuItem>