()
| 24 | type BenchmarkRenderer = Awaited<ReturnType<typeof testRender>>; |
| 25 | |
| 26 | async function createBenchmarkRenderer() { |
| 27 | const setup = await testRender( |
| 28 | React.createElement(AppHost, { |
| 29 | bootstrap: createLargeSplitStreamBootstrap(), |
| 30 | }), |
| 31 | VIEWPORT, |
| 32 | ); |
| 33 | |
| 34 | // This script measures OpenTUI render-loop cost, not React test assertions. Keeping React's |
| 35 | // act environment enabled makes queued timer/microtask work drain through the test scheduler and |
| 36 | // can dominate the benchmark with harness time instead of frame time. |
| 37 | (globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = false; |
| 38 | |
| 39 | return setup; |
| 40 | } |
| 41 | |
| 42 | function frameHasHighlightedMarker( |
| 43 | frame: { lines: Array<{ spans: Array<{ text: string }> }> }, |
no test coverage detected