playwright/packages
Simon Knott b3d767fa14
fix(trace viewer): fix memory leak (#32379)
In the `visit` method, we currently cache the rendered HTML for every
walked node. This re-use works well for traces that consist mostly of
references to earlier snapshots.
But for traces that don't share much, this is a large memory overhead
and leads to the memory crash documented in
https://github.com/microsoft/playwright/issues/32336. For the algocracks
amongst you, the current memory usage for an html tree $h$ is
$\mathcal{O}(|h| * \text{height}(h))$.

This PR removes that cache from the nodes and replaces it with a
snapshot-level cache, fixing the memory crash.
Traces *without* reference should not see a performance impact from
this.
Traces *with* references will have slower initial rendering, but
re-rendering maintains speed because of the snapshot-level cache.

Closes https://github.com/microsoft/playwright/issues/32336

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-09-04 09:57:15 +02:00
..
html-reporter feat(html reporter): open html attachments in new tab (#32389) 2024-09-02 08:35:53 +02:00
playwright chore(test runner): always go through internal reporter (#32426) 2024-09-03 22:38:02 -07:00
playwright-browser-chromium chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-browser-firefox chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-browser-webkit chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-chromium chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-core feat(firefox): roll to r1463 (#32439) 2024-09-04 08:49:10 +02:00
playwright-ct-core fix(test runner): align with typescript behaviour for resolving index.js and package.json through path mapping (#32078) 2024-08-12 15:05:19 +02:00
playwright-ct-react chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-ct-react17 chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-ct-solid chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-ct-svelte chore(deps-dev): bump svelte from 4.2.9 to 4.2.19 (#32398) 2024-09-02 15:16:46 +02:00
playwright-ct-vue fix(ct): vue jsx component.update type (#32213) 2024-08-19 05:50:25 -07:00
playwright-ct-vue2 chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-firefox chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-test chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
playwright-webkit chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
protocol/src chore: pass explicit recorder app factory (#32349) 2024-08-27 20:24:19 -07:00
recorder chore: allow recorder rewrite annotations (#32381) 2024-08-29 14:16:01 -07:00
trace/src feat(trace viewer): show baseURL in Metadata pane (#31852) 2024-07-25 17:14:46 +02:00
trace-viewer fix(trace viewer): fix memory leak (#32379) 2024-09-04 09:57:15 +02:00
web chore: roll codicon (#32234) 2024-08-20 10:56:46 -07:00
.eslintrc.js chore: replace process.exit with graceful closure (#24242) 2023-07-24 08:29:29 -07:00