cli
cli copied to clipboard
✨ Enhance performance logging in snapshot and serialization processes
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 theperfInfoobject of the serialized output. TheperfInfoobject 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 thedebugSnapshotOptionsfunction to log performance information (perfInfo) from thedomSnapshotobject, if available.
Code updates for node cloning:
packages/dom/src/clone-dom.js: Incremented a newclonedNodeCountproperty in thectxobject to track the number of cloned nodes during the DOM serialization process.
Miscellaneous:
packages/dom/src/serialize-dom.js: Added a global reference to theperformanceobject to enable performance timing.
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.
This PR was closed because it has been stalled for 28 days with no activity.