[PM-35196] add rerendering benchmark#486
Conversation
Runtime flags cannot be controlled from within BIT.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR introduces a Playwright-based benchmark harness as a separate vertical from the existing test suite, adding a new fixture ( Code Review DetailsNo findings to report. The shared |
There was a problem hiding this comment.
Oops, wrong PR! Sorry. Disregard.
One non-blocking comment/question/nit: Should we update the JSDoc comment at performance.ts#L191 to add the new namespace (${name}:poison > ${name}:poison:autofill:bw?
I added my review and comment to the wrong PR. So silly, so sorry.
jprusik
left a comment
There was a problem hiding this comment.
A few nits and observations, but nothing blocking
| Run the benchmark suite: | ||
|
|
||
| ``` | ||
| npm run benchmark:static |
There was a problem hiding this comment.
The static in the other node commands is to distinguish between the "live" site tests (which we do not run in CI, and do not want to run accidentally locally). We could probably drop it (unless you feel there's value in running benchmarks against the live website hosting a copy of the target page).
It probably would be helpful to encode what we're benchmarking in the command however, since we will likely introduce other benchmark vectors in the future.
There was a problem hiding this comment.
I'm following the convention that each suite of tests gets its own folder. test:static runs the tests in the tests/static folder. benchmark:static runs the benchmarks in the benchmarks/static folder. I could rename it test-site or something similar, so it matches the folder that contains the test-the-web code.
When it runs benchmarks, it's running the whole suite sequentially, at least for now. You get all of the output from all benchmarks that ran in test-summary/benchmark-summary.csv, labeled by suite and the page the measure was captured on.
There was a problem hiding this comment.
We should probably capture (not now, but in future iterations) the shared config concerns in a base file and import them into the (now divergent) benchmark and test configs.
There was a problem hiding this comment.
I think that largely comes down to sharing use, projects and webServer.
The benchmark config eliminates a lot of the nice things in the test config because they could interfere with timing.
| "test:static:debug": "npm run pretest && NODE_EXTRA_CA_CERTS=ssl.crt playwright test tests/static --debug", | ||
| "test:static:headless": "npm run pretest && NODE_EXTRA_CA_CERTS=ssl.crt HEADLESS=true playwright test tests/static", | ||
| "test:static:autofill": "npm run pretest && NODE_EXTRA_CA_CERTS=ssl.crt playwright test tests/static/autofill-forms.spec.ts", | ||
| "benchmark:static": "rimraf benchmarks-out test-summary/perf test-summary/perf-summary.csv && tsc --incremental -p benchmarks/tsconfig.json && NODE_EXTRA_CA_CERTS=ssl.crt playwright test --config=playwright.benchmark.config.ts", |
There was a problem hiding this comment.
Once we've had some time with it, we should update the project README with some details about what this is (similar to the a11y tests) and link to the README in the benchmarks folder.
There was a problem hiding this comment.
Yeah, I agree. I didn't add it into the root README because it's already quite long, and I didn't want to make it longer. 😅
Over time, I'm hoping that we can split it out a bit, providing instructions for a routine setup in the root README, and then using the docs/ folder for more complex setups, troubleshooting, and so on. This PR adds a new README in benchmarks and stuff into docs/, which I need to clean up. I think the benchmark readme is probably better as a Claude skill; that takes much more time to get right, though.
I'll circle back around once we've got a fix in place for our immediate performance bottleneck.
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-35196
📔 Objective
Introduce BIT benchmarks. The first benchmark targets the rerendering input grid scenario.
Benchmarks are implemented as a separate vertical from the existing BIT tests. There's some in-depth documentation explaining detailed design decisions and usage.