Add Plotly.profile() API for performance profiling #7657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds a new
Plotly.profile()API method that enables users to diagnoserendering performance of their Plotly charts by collecting timing data for each
phase of the rendering pipeline.
Motivation
Users often ask "why is my chart slow?" but currently have no built-in way to
diagnose where time is being spent. This profiler provides visibility into the
rendering lifecycle, helping users understand whether bottlenecks are in data
processing (
doCalcdata), DOM manipulation (drawFramework), or actual drawing(
drawData).Future direction: This MVP focuses on timing collection. Down the line, this
could potentially be extended to:
scattergl for datasets > 10k points")
I wanted to get community feedback on the core API before expanding scope.
What this PR does
Plotly.profile(gd, [enable])to enable/disable profiling on a graph divdrawData, etc.
gd._profileDataafter each renderplotly_profiledevent for reactive integrationsUsage