BLove
Posts: 11
Joined: Fri Nov 20, 2020 6:56 pm

Scatter plot extremely sluggish under boost threshold

Hello,

I'm trying to create a scatter plot graph with xy zoom capabilities with scrolling possibilities using Highstocks scrollbar.

When I create a graph sitting at just under the default boost threshold (4999 points in 1 series), and then zoom in, scrolling becomes extremely sluggish when clicking on the scroll bar to do paged scrolling. You can see this in this fiddle here:

https://jsfiddle.net/bloved/cd5xso3z/24/

However, if instead of enabling the scrollbar from inside the xaxis, i do it on the more general scrollbar:{} option, performance becomes much faster, though with still a very slight but noticeable latency. This would be well and good, but im looking to apply the scrollbar to the y-axis as well, and the general scrollbar options only apply to the xaxis according to the documentation. Anyway, this fiddle below is with the faster scrolling because of scrollbar being defined more generally:

https://jsfiddle.net/bloved/cd5xso3z/25/

My first question is, why is defining the scrollbar generally at a high level so much faster, on the order of tens of seconds for only 4999 points, compared to defining the scrollbar inside the x-axis structure, for a per axis basis.

Second, if I profile the time around it attempting to do a paged scroll on the first example, we see the output shown here:
https://imgur.com/a/WnhDoGr
It seems like all of the (many) drawPoints calls have something below them that significantly holds up the drawPoints calls, to where a single one was taking up to 200ms, which with many calls to drawPoints is adding up quickly, so where is all of that time going when defining the scrollbar like in the first fiddle.

As a note, if I were to increase the number of data points to 5000 in order to hit the boost threshold, the performance of the graph is fine, as boost kicks in to take care of the extra data, but I would presume having only 4999 points without boost should have been performant but is clearly not.



Thanks for any help you can offer.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Scatter plot extremely sluggish under boost threshold

Hello BLove!

We appreciate you reaching out to us!

The whole problem is related to scrollbar.liveRedraw property. When it's set to true it works slower because each series is re-rendered with any mouse move. When it's set to false it works faster. But in both situations (defining scrollbar on xAxis or on the chart) the value of this property should be the same. The conclusion is that we've got a bug over there!

Regarding 5000 points performance, it's a default amount of points, when the chart enters boost mode. If it doesn't work for you well, you can always change it to e.g 2000.

API references:
https://api.highcharts.com/highcharts/s ... tThreshold
https://api.highcharts.com/highstock/sc ... liveRedraw

Let me know if you have any further questions!
Best regards!
Dominik Chudy
Highcharts Developer
BLove
Posts: 11
Joined: Fri Nov 20, 2020 6:56 pm

Re: Scatter plot extremely sluggish under boost threshold

Thanks dominik.c!

By any chance, could you link the bug thats logged against the slowdown on the axis definitions so I can track it as it goes, and update my highcharts version when its released?
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Scatter plot extremely sluggish under boost threshold

Hi again!

Sure, here you've got a link: https://github.com/highcharts/highcharts/issues/15218

You can also bump it anytime with any question related to this issue. :-)

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Stock”