Optimize markers calculations#826
Conversation
|
This CI is broken... |
|
You literally commented that when I was about to push it 😄 |
TheLastGimbus
left a comment
There was a problem hiding this comment.
This may look kinda hack-ish, but this actually brough whole loop's time (on my tablet) from ~20 to ~10ms! On 5k markers!
(As always: When zoomed to no markers and not zooming in/out)
|
@ibrierley You proposed to cache them per-zoom-level. Out of curiosity, I printed when zoom changes and: We probably couldn't phisically fit so many |
Okay, this is ready for review and merge
I have 30 fps at 5k markers and 60 at 2.5k - not bad 👍 |
One important thing I noticed:When you have a simple widget as markers, and make it a We could add this hint somewhere in the documentation (but, of course, behavior between devices/widget cases can vary) |
- change to stateful - make loop nicer
|
Any news on this? |
|
I was just about to apologize that I'm running late with pushing commits as always, but, oh, it's not me 😄 We are just waiting for @johnpryan review 👍 |
No worries mate, what kind of performance improvements can except for example with 2000 markers and 200 visible. |
|
Yeah, not that much, but it's always something I think we need to make some new plugin for markers that will base on Edit: Oh, if that was a question - on my tablet, 3,5k markers where ~20fps when zoomed to 30 visible, and like 15fps when 200 visible. After optimization, 3.5k 60fps when <100 visible, then maybe 45fps when 200 visible 👍 |
Thanks! Keep up the good work and sorry I phrased my question oddly. 😅 |
kengu
left a comment
There was a problem hiding this comment.
All RFCs from @johnpryan are resolved in code. LGTM.
|
@TheLastGimbus The only remaining thing to do is to resolve the conflicts with master in lib/src/layer/marker_layer.dart |
# Conflicts: # lib/src/layer/marker_layer.dart
Or my IDE is just useless
|
Done! All working, markers rotating correctly 👌 @kengu ready to merge 👍 |
|
@TheLastGimbus I got this error in the log when opening the "A lot of markers" page in the example-app. This fixes it @johnpryan I've testet this on my phone and it looks good. The merge is blocked by your request for change, which I think is mostly resolved. |
Done 💯 |
|
@kengu you can pretty much press merge 👌 |
Waiting on @johnpryan - unable to merge until changes are ack-ed by him |
This PR is attempting to optimize and shrink all calculations that are done when user drags map with a lot of markers
Hopefully, I will get it to state where we have full 60 fps with 5k markers, but we will se how it goes
Fixes #824
I would really want toYeah, pretty much - I don't see we how could do much better than this