-
Notifications
You must be signed in to change notification settings - Fork 994
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
Slowness detected with 50,000 Pins on Latest Chrome(74.0.3729) #951
Comments
Same issue here. All of a sudden our maps with ~50.000 markers takes ages to load in Chrome 74. Example: https://five.epicollect.net/project/campaign-education Works fine in other browsers and previous versions of Chrome. We tested (on a Mac)
Any suggestions? Can we help somehow? @danzel |
I've been working on a workaround lately. The idea is that instead of adding all markers in one step, I've splitted my markers in group of 2000 and add them one after the other using Instead of spending for 20 second in clusters creations, it goes down to 660 ms for an input of 16000 markers. |
@tetedacier so you are adding multiple layers, one per each group? Is it not what The thing is everything has always worked fine until Chrome 74, so I wonder what they changed in the browser to cause this 50x slowness compared to before |
It seems that the addLayers function is having trouble with the new version of chrome. Try to iterate over your markers and add them one by one as @tetedacier said with addLayer. Fixed my issues with 70k markers. |
so yeah trick is to add markers one-by-one instead of a big chunk at once. |
I dont think this should be closed though - the issue still persists with addLayers which is supposed to handle this kind of functionality .. I guess? |
I would not close this either, addLayers() does not work as it should. There are some reasons that function was recommended I guess. Is there any chance to fix that function instead of applying workaround?? If that is not possible, the docs and the 50K example needs to be updated. |
@mirko77 @mathiaslaramee Agreed, I opened it already :) |
This sounds like a chrome bug. |
I would do that but what do I report? We will have to look for the Javascript native functions in addLayers() that do not work as they should and build a fiddle for the Chrome guys. |
Javascript changes in Chrome 74, do anything ring a bell? |
Using this approach i loaded 1 lac markers in 5 sec |
@rahulmahadik that is still using |
I posted the example code and screenshot |
The issue is on: Are you using the above Chrome version/Mac version? If not, your example is not relevant. There are not any issues on other Chrome versions. |
I'm using Chrome Version 74.0.3729.169 (Official Build) (64-bit) |
I digged this issue deeper, since my split strategy stopped to be effective at 100.000 markers. It seems that all the time is spent inside the hasLayers method. I'm preparing a PR with a modified version of addLayers which doesn't call the hasLayer method since when I'm initially loading the markers, this method just consume time and allways return false. |
@tetedacier is |
@mirko77, Yes it is the same. |
My clustering code was slow too... But when I change the process order, the problem goes away:
In this way, there is no lagging. So, add markers to the cluster AFTER the cluster has been added to the map. Maybe it helps. |
What @petrot writes seems to work successfully for me as well. |
How to reproduce
Just visit the official url, with 50,000 items, on aforementioned chrome version(which is latest):
https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.50000.html
What behaviour I'm expecting and which behaviour I'm seeing
Show map and load data in few seconds but it's taking around 2 mins to show map and then load pins. However on safari, it's loading in ~10 secs.
Minimal example reproducing the issue
The text was updated successfully, but these errors were encountered: