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.

Improve point render performance with spatial index

See original GitHub issue

Hi @swharden & Team,

perhaps I had mentioned it before. The point drawing performance becomes very slow with large dataset’s Here is an example with 2.5 million points. In this view i zoomed in so that about 1000 points are visible: image

As you can see, a lot of render time is wasted. Probably all points are rendered? The AddScatterPoints function was used. Is it perhaps useful to use a spatial index like the R-tree? You can think about it 😃

Version: ScottPlot 4.1.9-beta Thank You!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AlgoExecutorcommented, Mar 23, 2021

Hi @StendProg ,

that’s totally ok. The conversation with you was really nice and I could implement the small quickfix. And as you say, even this can be improved with integer rounding. Would be nice if you could find point cloud solution from which other users of ScottPlot can benefit without writing their own renderer 😉

If I think of anything else on the subject I’ll write it here…

0reactions
StendProgcommented, Mar 18, 2021

Hi @AlgoExecutor,

I played a little bit 😃 Just filtering out the points that lie on top of each other brings considerable progress in the initial view. So it is possible to reduce the points from 2.557.503 to 871.267. 66% reduction. Not bad far a start. Code I used:

The solution is very interesting for its simplicity, I think you can get a greater effect if the coordinates are previously rounded to integer values.

It was very pleasant to participate in the discussion and many ideas were expressed. But I guess I’ll take a break until I get to coding and try to dig deeper on my own, otherwise we’ll just talk about what.

Read more comments on GitHub >

github_iconTop Results From Across the Web

QGIS rendering performance bottleneck?
The spatial index can improve the speed of rendering your data in QGIS. To create spatial index, go to layer properties -> General...
Read more >
How to Speed up QGIS (Rendering)
Multi-threaded rendering should speed up your performance significantly! ... Go to Layer Properties -> General -> Create Spatial Index.
Read more >
Optimizing map content for performance—ArcMap
Using attribute or spatial indexes—If the data source allows it, index any fields used for querying or rendering. Indexes are specific to each...
Read more >
How do I improve SQL spatial query performance?
I've have tried to use various spatial indexes, however I cannot seem to get the query to run more consistently and at a...
Read more >
Boosting PostGIS Performance - Symphony
The spatial index helps to narrow down the records from the table whose bounding boxes intersect with our AOI rectangle, so PostGIS needs...
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