Pre loader

IRenderableSeries.HitTest performance problem

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I’ve noticed huge performance decline in IRenderableSeries.HitTest function in the latest 2.3 version compared to version 2.1.1.
For chart with 1.5mln points calling this function is now about 1000 times slower then in earlier version (from ~40 tics to ~40000). I can provide some sample code if required.

  • You must to post comments
Best Answer

Just to let you know, one of our team investigated deeply today, this is what he said:

The example appends several thousands points with same X coordinates, so I think performance decrease is because of implementing correct hit test for points with same X values. This improvement was originally requested by users who use scatter charts to append points with same X values.

In 2.1.1 we didn’t support such case at all – we just use binary search to iterate through sorted points till we find nearest datapoint based on only X coord. In later versions after we find this X point we’re trying to find all points with such X value to determine which of them is nearest one, then we need to find all Y points with the same X-Value to find the nearest actual hit test point. So this 1000x decreasing of performance is because we’re trying to find correct nearest point from 1000++ points instead just finding first one with valid X value.

What we’re doing now is as a team analysing the hit-test code in depth and seeing if we can rephrase it to support all the new use-cases (such as finding nearest X then Y) as well as delivering high performance. It’s not an easy task but we are taking it seriously. I will keep you informed.

Best regards,

  • Andrew Burnett-Thompson
    Just an update on this. Sergey on our team has re-written the hit-test functions in our Trunk branch (for SciChart v3.0). He has managed to significantly improve speed (about 50x faster than v2.3). However, it is still slower than v2.11. It can never go back to that original speed as mentioned, the old algorithm was producing incorrect results. We will be releasing an update to SciChart v3.0 soon and full details about the API changes will be in the release notes.
  • anth
    Ok, thanks, I hope this will be enough in my case
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.