Skip to content

Commit 3e0cbdc

Browse files
committed
No throttling
1 parent 1f7cfde commit 3e0cbdc

5 files changed

Lines changed: 6 additions & 90 deletions

File tree

examples/benchmark-react/PLAN.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

examples/benchmark-react/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The repo has two benchmark suites:
1414
- **What we measure:** Wall-clock time from triggering an action (e.g. `mount(100)` or `updateAuthor('author-0')`) until the harness sets `data-bench-complete` (after two `requestAnimationFrame` callbacks). Optionally we also record React Profiler commit duration and, with `BENCH_TRACE=true`, Chrome trace duration.
1515
- **Why:** Normalized caching should show wins on shared-entity updates (one store write, many components update), ref stability (fewer new object references), and derived-view memoization (`Query` schema avoids re-sorting when entities haven't changed). See [js-framework-benchmark "How the duration is measured"](https://github.com/krausest/js-framework-benchmark/wiki/How-the-duration-is-measured) for a similar timeline-based approach.
1616
- **Statistical:** Warmup runs are discarded; we report median and 95% CI. Libraries are interleaved per round to reduce environmental variance.
17-
- **CPU throttling:** 4x CPU slowdown via CDP to amplify small differences on fast CI machines.
17+
- **No CPU throttling:** Runs at native speed with more samples (3 warmup + 30 measurement locally, 15 in CI) for statistical significance rather than artificial slowdown.
1818

1919
## Scenario categories
2020

@@ -95,14 +95,10 @@ Regressions >5% on stable scenarios or >15% on volatile scenarios are worth inve
9595
Playwright needs system libraries to run Chromium. If you see "Host system is missing dependencies to run browsers":
9696

9797
```bash
98-
sudo npx playwright install-deps chromium
98+
sudo env PATH="$PATH" npx playwright install-deps chromium
9999
```
100100

101-
Or install manually (e.g. Debian/Ubuntu):
102-
103-
```bash
104-
sudo apt-get install libnss3 libnspr4 libasound2t64
105-
```
101+
The `env PATH="$PATH"` is needed because `sudo` doesn't inherit your shell's PATH (where nvm-managed node/npx live).
106102

107103
2. **Build and run**
108104

examples/benchmark-react/bench/runner.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,6 @@ async function main() {
238238
const context = await browser.newContext();
239239
const page = await context.newPage();
240240

241-
try {
242-
const cdp = await context.newCDPSession(page);
243-
await cdp.send('Emulation.setCPUThrottlingRate', { rate: 4 });
244-
} catch {
245-
// CDP throttling is best-effort
246-
}
247-
248241
for (const scenario of SCENARIOS_TO_RUN) {
249242
if (!scenario.name.startsWith(`${lib}:`)) continue;
250243
try {

examples/benchmark-react/bench/scenarios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,5 @@ export const SCENARIOS: Scenario[] = LIBRARIES.flatMap(lib =>
177177
),
178178
);
179179

180-
export const WARMUP_RUNS = 2;
181-
export const MEASUREMENT_RUNS = process.env.CI ? 5 : 20;
180+
export const WARMUP_RUNS = 3;
181+
export const MEASUREMENT_RUNS = process.env.CI ? 10 : 15;

examples/benchmark-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@types/react": "19.2.14",
3636
"@types/react-dom": "19.2.3",
3737
"playwright": "1.58.2",
38-
"serve": "14.2.4",
38+
"serve": "14.2.6",
3939
"tsx": "4.19.2",
4040
"typescript": "5.9.3",
4141
"webpack": "5.105.3",

0 commit comments

Comments
 (0)