Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2k
Add Plotly.profile() API for performance profiling#7657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
emilykl commentedDec 4, 2025
Thank you for the contribution@Rhoahndur ! Profiling tools would be a great addition to the library, and we like the simplicity of this approach. Could you explain why you chose these specific points to mark? Could you open an issue and link it to this PR, describing the motivation for this work? What you have in the Motivation section is a great start; if you could provide specific examples of charts you have wanted to profile, that would also be helpful background. It would also be helpful to see an example of the intended usage for this feature — would you be willing to put together a small demo of the profiler in action, with a few different charts that take different amounts of time to render, maybe onCodepen? You can link tothe Plotly.js artifact from CircleCI so that this branch's changes are included. |
Uh oh!
There was an error while loading.Please reload this page.
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
Files changed
Checklist
npm run lintpassesnpm run test-jasmine -- profile)Note: This is my first contribution to plotly.js (working on two PRs for this
project). I've done my best to follow the contribution guidelines and existing
code patterns, but I'm very open to feedback on the API design, implementation
approach, or anything else. Thank you for taking the time to review!