-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use the reloadTile
worker method if GeoJSON tile is already loaded
#4069
Conversation
f373964
to
47320de
Compare
jsfiddle showing extreme slowness http://jsfiddle.net/vk2knag7/1/ |
There was a bug when |
4dee108
to
5a5cf36
Compare
CI failed on lint, fixed and re-running. |
Nice! We ran into this issue with a |
This is great!
|
Thanks! Re races: I don't see an opportunity for a race between those two; the geojson index and the Re tests: Not sure how to test this but hopefully others with more experience can fill this in. |
Hey @ezheidtmann, let's work together on shipping this PR! Want to rebase against the current master as the first step? |
5a5cf36
to
8a9051b
Compare
Hey @mourner sorry for the long silence, I've been buried in other work during Bike Month. I rebased and it looks good; I can test later today that my app still has acceptable performance. Re tests: To guard against regressions, we can test that |
@ezheidtmann great, no worries! Re tests, I think it's enough to make sure tile is reloaded. We can cover benchmarking separately later. |
I wrote a test. It took me a lot of time. I hope it is not absurd or wrong. |
c811f9c
to
5065507
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that was indeed quite difficult! Thanks for taking the time to do that — highly appreciated. And sorry that it too so long.
👍 Thanks! |
During a style update, the source is reloaded. Because
GeoJSONSource
always callsloadTile
in the worker, this means that any style change causes all tile PBFs to be regenerated. This makes hover effects on geojson sources very slow.This PR fixes the performance issues by using the
reloadTile
worker method, just as inVectorTileSource
. I believe we don't need to worry about theloading
state because theGeoJSONSource#loadVectorData
calls its callback synchronously, so there's only two branches here.These changes perform very well in my use case but is relatively untested.
Symptomatically related to issues discussed here: #2874
Thanks a lot, yall!
Launch Checklist