question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Marker performance issue

See original GitHub issue

Hi @alex3165, recently switched over to testing out your library for my project. So far it’s greatly reduced complexity, however I’ve found that my performance has drastically decreased. I can easily generate 1000s of markers on my map and I’ve found that FPS starts to drop to 4 - 6 fps at just a few hundred. I’ve made a sample slow app:

https://github.com/benrudolph/react-mapbox-gl-debug

This only generates 1000 markers, and it’s not quite as slow as my app, but you can still definitely start to see the delay. On a map that has a decent amount of complexity in the markers this gets unusable. I did some profiling and this was the result:

screen shot 2017-11-25 at 4 00 23 pm

Which points to a lot of time spend on firing events when moving the map and causing things to re-render. Let me know if you have any thoughts on this. Mapbox normally handles 1000s of markers without any delay

EDIT: Looked at the source code for this. I believe this is because this library doesn’t use the native Marker element and applies its own HTML transforms to update marker’s position.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
codepreneurcommented, Feb 5, 2018

@benrudolph @alex3165 I am having same performance issues because I have to display complex things on the map and have to use html markers. Is there a way to setState on ‘moveend’ without tweaking the internals?

1reaction
alex3165commented, Nov 29, 2017

It is useful only if you really have to display something “complex” on the map (video, image, react component…) but if you just want to display many icons you should rather use Layer and Feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance – Markers (500+) showing up delayed / slowly
Hello there,. we are experiencing quite a delay from the inital page- / mapload to the markers showing up. We have around 500...
Read more >
Google Maps Platform best practices: Optimization and ...
So the takeaway here is to use raster images for better performance if you intend on putting a lot of markers on the...
Read more >
Bug: Poor performance adding markers: each ... - Issue Tracker
Adding a marker takes about 24-28ms, while removing a marker is much faster. Since this must happen on the UI thread, an app...
Read more >
Map marker clustering in React Native just got easier - ACI Blog
Rendering 100+ markers on a map causes significant performance issues since React Native has to communicate updates between the native and ...
Read more >
Optimization Guide | Google Maps Platform
As a general rule, it is good practice to avoid performance-intensive non-drawing operations in a Draw() method. For example, avoid the following in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found