You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance regression: feature-state _idMap building is expensive #7110
@go-d it also looks like it heavily depends on the style the map uses — I don't get anywhere near results like that with the usual mapbox-streets-v10. Can you share the style id you're using?
@mourner No, patch 1 and patch 2 are independent tests. So #7015 is still quite a bit slower: 1.6s vs 1.2s pre-featurestate. Also not at all dependent on style.
@go-d thanks for a great test case! It makes it clear that TTFR directly depends on the JSON size that's transferred — without feature ids, it transfers 8kb, and with it, 15.5MB (!). I'm now experimenting with a different data structure for id mapping to see if we can get close to former performance...
Thinking about further improvements — I'm not sure if we'll manage to delay this work until after the first render because it would mean reparsing all the tiles again, which seems more wasteful. Avoiding it completely would also require full reparse on the first setPaintProperty with feature state. So perhaps we have to just live with a 7-16% drop — at least it would be manageable (compared with a 4x slowdown).
Activity
mourner commentedon Aug 14, 2018
#7124 might also somewhat help. @go-d can you describe how exactly you measure TTFR so that we're aligned on measuring impact of various changes?
go-d commentedon Aug 14, 2018
How I measure:
For my data, to get some idea of the impact:
[1]
[2]
mourner commentedon Aug 14, 2018
@go-d thanks! So, #7015 does almost bring it down to pre-featurestate levels? 1.6s vs 1.2–1.7s.
mourner commentedon Aug 14, 2018
@go-d it also looks like it heavily depends on the style the map uses — I don't get anywhere near results like that with the usual
mapbox-streets-v10. Can you share the style id you're using?go-d commentedon Aug 14, 2018
@mourner No, patch 1 and patch 2 are independent tests. So #7015 is still quite a bit slower: 1.6s vs 1.2s pre-featurestate. Also not at all dependent on style.
Single tile used for testing:
0.pbf.gz
mourner commentedon Aug 14, 2018
@go-d thanks for a great test case! It makes it clear that TTFR directly depends on the JSON size that's transferred — without feature ids, it transfers 8kb, and with it, 15.5MB (!). I'm now experimenting with a different data structure for id mapping to see if we can get close to former performance...
I meant including the underlying tile data used.
mourner commentedon Aug 15, 2018
@go-d please check out #7132 — it should be on par or faster than #7015 while also avoiding frame drops.
go-d commentedon Aug 15, 2018
@mourner
So same, but rounded off, so did a couple measurements: getting 7% slower with #7132 compared to pre-feature-state. Looking good.
Lower than the 10-20% you got. Tried Chrome instead of Firefox and got 16%.
mourner commentedon Aug 15, 2018
@go-d great!
Thinking about further improvements — I'm not sure if we'll manage to delay this work until after the first render because it would mean reparsing all the tiles again, which seems more wasteful. Avoiding it completely would also require full reparse on the first
setPaintPropertywith feature state. So perhaps we have to just live with a 7-16% drop — at least it would be manageable (compared with a 4x slowdown).