-
-
Notifications
You must be signed in to change notification settings - Fork 893
fix(example): updated marker stress test to use more stressful markers #2122
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
fix(example): updated marker stress test to use more stressful markers #2122
Conversation
|
As a note. In this edited demo I noticed that when all markers are visible, preformance is ok, but as soon as I pan and some markers are outside the screen performance degrades significantly. Should be opposit, that performance improves. as less markers are on screen. 2025-07-08.22-00-37.mp4 |
|
many_markers.dart seems to have a formatting issue. Try to run |
|
If this demo has a performance issue like @ReinisSprogis mentioned, then that needs to be fixed before merge. I'll test it out. |
…/flutter_map into marker_demo_update
|
@josxha Ah. Yes. I have a custom formatting rule that allows for longer lines before brake it. |
|
@JaffaKetchupI don't think it's related to the demo itself. I tested the original demo by simply swapping ColoredBox with Icon and observed the same result. ColoredBox might have been too primitive to reveal the issue. Replacing it with any slightly more complex widget causes noticeable lag. I'm just speculating here, but maybe when all markers use the same widget, same color, size, and structure. Flutter applies some optimization under the hood, recognizing they're identical. As you can see, there's a clear difference between using colored markers and markers with a single color. Still, it's unusual that removing markers would degrade performance, unless there's inefficient filtering happening under the hood. Marker(
point: LatLng(doubleInRange(r, 37, 55), doubleInRange(r, -9, 30)),
height: 12,
width: 12,
child: Icon(
Icons.location_on,
size: 12,
color: Colors.primaries[r.nextInt(Colors.primaries.length)]
),
),2025-07-09.14-00-08.mp42025-07-09.14-12-43.mp4 |
|
From what I can see, the lag occurs when markers are being added or pruned. Need to look into that. But the good news is, the culling still seems to work - when fewer markers are on screen (ignoring the initial spike caused by the culling itself somehow), it's more performant. |
JaffaKetchup
left a comment
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.
LGTM, thanks!
This better reflects real life usage and looks better than rectangles. Updated to match single marker demo.