Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve "setFilter" performance on big GeoJSON datasets #2443

Closed
Pipoupi opened this issue Apr 14, 2016 · 6 comments
Closed

Improve "setFilter" performance on big GeoJSON datasets #2443

Pipoupi opened this issue Apr 14, 2016 · 6 comments
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@Pipoupi
Copy link

Pipoupi commented Apr 14, 2016

Hi,
I've been facing some performance issue since 0.16 and I can't upgrade because of that.
Please refer to my fiddles :
Map with symbols on mapbox gl js 0.15
Map with symbols on mapbox gl js 0.17

Loading is longer, as popup are on mousemove. But the biggest difference is on filter function. Performance is increased if I change symbol with circle (even if it's not my goal but it's for testing) but still 0.15 is better than 0.17.
Map with circle on mapbox gl js 0.15
Map with circle on mapbox gl js 0.17

Loading is very long because of my huge json
I need to stack filters, that's why I'm using an array with a lot of empty filters

@mourner
Copy link
Member

mourner commented Apr 14, 2016

Profiled this example and the regression seems to be caused by the conversion to pbf due to the queryRenderedFeatures changes. cc @ansis Let's investigate further.

@mourner mourner added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Apr 14, 2016
@mourner
Copy link
Member

mourner commented Apr 14, 2016

To be fair, this is 35MB of point data, quite an extreme case. While I'd like to investigate performance here, have you looked at speeding up the thing e.g. with point clustering?

@Pipoupi
Copy link
Author

Pipoupi commented Apr 14, 2016

I used to cluster my map with openlayers before I knew Mapbox & your awesome perf :) but my product has to replace marine traffic app (with cluster view) which my client had a subscription for, and it's quite more impressive for them to see all of these vessels,it's like a show case when they have visitors.. They're like "Hey, see all these vessels in that area? Some are mine".
I'm not criticizing your new version, but it's so frustrating to look at really good new function like queryrenderedfeature and querysourcefeature and can't be able to use them !
Anyway, I just can't go back to a clustered map

@mourner
Copy link
Member

mourner commented Apr 14, 2016

OK, I'll see what we can do here. We probably won't be able to fully get rid of the performance hit here, but we might be able to significantly reduce it.

@mourner mourner changed the title Lower performance since 0.16 setFilter performance regressed for big GeoJSON datasets Apr 27, 2016
@andrewharvey
Copy link
Collaborator

andrewharvey commented Jun 22, 2016

I don't think this is unique to GeoJSON sources, I've noticed Mapbox Tileset sources have the same poor performance for hover interactivity when using setFilter on a hover layer. Do you need a minimal example of this too?

@lucaswoj lucaswoj changed the title setFilter performance regressed for big GeoJSON datasets Improve "setFilter" performance on big GeoJSON datasets Jul 29, 2016
@mourner
Copy link
Member

mourner commented Jul 31, 2018

Now that we have Feature State API, this is not a pressing issue, so I'm going to close for now.

@mourner mourner closed this as completed Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

3 participants