question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plotly.redraw / drawLabels performance

See original GitHub issue

I came across the problem, that redrawing the plots (with new data) takes a lot of time. E.g. in the attached profile graph one single plot took around 40ms, where half of the time(!) is spent for drawAxes, or more precisely drawLabels.

Having half of the redraw time spent on doing labels? Seems quite inappropriate to me and I wonder if this can be speed up?

The problem is that it adds up quite a lot when having multiple plots at one page, just 10 plots and suddenly the redrawing process takes half a second.

Since the problem lies in drawLabels, it also doesn’t help to reduce the data (doesn’t matter much if 5 or 500 points are plotted).

Of course, better performances is everywhere nice, but looking at the profile I’ve got the feeling that drawLabels might be the best start to get some more.

Profile graph

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
blankclemenscommented, Mar 2, 2016

A small hack if one just needs more performance: Removing fixLabelOverlaps saved 10-20ms and didn’t change my output. Of course, some functionality will be gone, but I had no overlapping labels anyways. 😉

But of course, the problem is not solved with half the time - 20ms for a single plot are still way to much.

1reaction
etpinardcommented, Sep 6, 2019

PR https://github.com/plotly/plotly.js/pull/2487 has made some improvements. From https://github.com/plotly/plotly.js/pull/2487#issuecomment-376201070, here are a few more things we should do to help Axes.doTicks performance:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Function reference in JavaScript
This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot .
Read more >
Performance of plotly.relayout with more than 1000 points
Hi there, I'm wondering if the performance of the relayout function is dependent of the number of points plotted on the graph.
Read more >
Ways to speed up rendering / plotting performance
Hi everyone, I'm looking for all kinds of ways to speed up the rendering of plots in JavaScript, maybe we can collect some...
Read more >
Performance | Dash for Python Documentation
The main performance limitation of dash apps is likely the callbacks in the ... Currently, Dash redraws the entire graph on update using...
Read more >
A brand new website interface for an even better experience!
Plotly.redraw / drawLabels performance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found