MCPcopy Create free account
hub / github.com/modem-dev/hunk / createBenchmarkRenderer

Function createBenchmarkRenderer

benchmarks/large-stream.ts:26–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24type BenchmarkRenderer = Awaited<ReturnType<typeof testRender>>;
25
26async 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
42function frameHasHighlightedMarker(
43 frame: { lines: Array<{ spans: Array<{ text: string }> }> },

Callers 2

measureFirstFrameMsFunction · 0.85
measureScrollTicksMsFunction · 0.85

Calls 1

Tested by

no test coverage detected