cli icon indicating copy to clipboard operation
cli copied to clipboard

✨ Enhance performance logging in snapshot and serialization processes

Open ninadbstack opened this issue 5 months ago • 2 comments

This pull request focuses on enhancing performance tracking and debugging capabilities in the DOM serialization process. Key changes include adding performance metrics to the serialized output, tracking the number of cloned nodes, and improving logging for snapshots. These updates aim to provide better insights into the performance and behavior of the DOM serialization process.

Enhancements to performance tracking:

  • packages/dom/src/serialize-dom.js: Added performance timing to measure the duration of the DOM serialization process (serializationTime) and included it in the perfInfo object of the serialized output. The perfInfo object also tracks the number of cloned nodes (clonedNodeCount), the length of the final HTML (finalHtmlLength), and the number of resources (resourceCount). [1] [2] [3]

Improvements to debugging:

  • packages/core/src/discovery.js: Enhanced the debugSnapshotOptions function to log performance information (perfInfo) from the domSnapshot object, if available.

Code updates for node cloning:

  • packages/dom/src/clone-dom.js: Incremented a new clonedNodeCount property in the ctx object to track the number of cloned nodes during the DOM serialization process.

Miscellaneous:

  • packages/dom/src/serialize-dom.js: Added a global reference to the performance object to enable performance timing.

ninadbstack avatar Aug 01 '25 12:08 ninadbstack

This PR is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Aug 19 '25 19:08 github-actions[bot]

This PR was closed because it has been stalled for 28 days with no activity.

github-actions[bot] avatar Sep 09 '25 19:09 github-actions[bot]