-
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
Blazing fast layer update #2174
Conversation
Awesome, could you do a jsfiddle that includes this patch so we can compare? |
@tmcw yes, was waiting for the build to complete. |
JSFiddle with the new build (inlined) that demonstrates the performance: https://jsfiddle.net/Mourner/0Lk8awwp/3/ |
Added another optimization that affects the example — avoid triggering an update when you set filter, layout property or zoom range to values that are already set. |
@@ -14,7 +14,8 @@ function styleBatch(style, work) { | |||
|
|||
batch._style = style; | |||
batch._groupLayers = false; | |||
batch._broadcastLayers = false; | |||
batch._broadcastAllLayers = false; | |||
batch._broadcastLayers = {}; |
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.
It's a little tricky that this._broadcastLayers
and this._style._broadcastLayers
both exist and are of different types
I disagree that this 🔥 is so bad that you don't have time to
If you have too much on your plate, I can take care of these tweaks. |
This looks great! |
Makes `setLayoutProperty`, `setFilter` and `setLayerZoomRange` much faster by limiting the style->worker transfer to just the updated layers instead of the whole style. Makes this hover example https://jsfiddle.net/0Lk8awwp/1/ fast and smooth again. cc @lyzidiamond @lucaswoj @scothis
This is especially helpful for cases where `setFilter` or `setLayoutProperty` are called on mousemove.
Makes
setLayoutProperty
,setFilter
andsetLayerZoomRange
much faster by limiting the style->worker transfer to just the updated layers instead of the whole style.Closes #2082 and makes this hover example https://jsfiddle.net/0Lk8awwp/1/ fast and smooth again: https://jsfiddle.net/Mourner/0Lk8awwp/3/
cc @lyzidiamond @lucaswoj @scothis