Files
orca/config/scripts/rolldown-thread-limit.test.mjs
T
OrcaWinandOrcaWin b252aef0cf perf(build): cap Rolldown threads on large hosts; build pairing web client in the background (#33828)
Rolldown defaults to 1.5x physical cores Tokio workers plus a Rayon pool per
logical CPU (24+24 here). Capping both at 8 on >8-core hosts cuts electron-vite
build CPU 24% with byte-identical output. pnpm dev no longer blocks on a stale
pairing web build; it stages into out/.web-next and swaps on success.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-26 00:51:28 -07:00

18 lines
606 B
JavaScript

import { describe, expect, it } from 'vitest'
import { withRolldownThreadLimit } from './rolldown-thread-limit.mjs'
describe('withRolldownThreadLimit', () => {
it('caps both pools on large hosts', () => {
expect(withRolldownThreadLimit({ A: '1' }, 24)).toEqual({
A: '1',
ROLLDOWN_WORKER_THREADS: '8',
RAYON_NUM_THREADS: '8'
})
})
it('keeps Rolldown defaults on small hosts and explicit sizes everywhere', () => {
expect(withRolldownThreadLimit({}, 8)).toEqual({})
expect(withRolldownThreadLimit({ RAYON_NUM_THREADS: '2' }, 24).RAYON_NUM_THREADS).toBe('2')
})
})