humangeo / leaflet-dvf

Leaflet Data Visualization Framework
MIT License
689 stars 153 forks source link

Performance issues when updating to 0.3.1 #109

Open nhinze opened 7 years ago

nhinze commented 7 years ago

I'm working to update to Leaflet 1.0 and dvf 0.3.1. I used to be on LL 0.7.7 and some version of dvf .2 (at least a year old if not more).

The drawing performance was great. I use FlowLines with CustomColorFunctions. Using the new dvf 0.3.1, it takes a few seconds to draw a FlowLine. My FlowLines have 100s of points.

Are there any known issues? How can I figure out what is slow?

sfairgrieve commented 7 years ago

@nhinze What was the issue? Just curious.

nhinze commented 7 years ago

Closing Chrome and restarting it fixed it. It seems that having the JS Console open slowly creates this slowdown after reloading the page many times.

nhinze commented 7 years ago

However, it appears the Chrome is still much slower at drawing dvf than before. I can see the FlowLine being drawn. Firefox has the same speed as Chrome. Safari on the other hand is very fast. This is on Mac. I have not tested Windows yet.

sfairgrieve commented 7 years ago

Can you share an example? If not, I can try to recreate it. Just curious on the specifics to help better understand what might be causing the issue.

nhinze commented 7 years ago

The LL 1.0 update is not live yet. I'm still doing a lot of testing. It probably will be a week or 2 before it goes live. Here is a link to show you how I'm using dvf using LL 0.77:

https://en.mycoursewalk.com/rides/720

sfairgrieve commented 7 years ago

Very cool app! This example definitely helps. I'll take a look and see if I can figure out what the problem might be.

sfairgrieve commented 7 years ago

Still looking into this. It's not clear why the performance is worse, but it does seem to be. One thing to play around with is the smoothFactor option (add this to layerOptions). Try a value greater than 1. Maybe something like 4 or higher. This seems to improve the performance in my testing.

sfairgrieve commented 7 years ago

@nhinze Did changing smoothFactor help at all? Just curious. Unfortunately, I haven't figured out any other answers at the moment, although I am still investigating.

nhinze commented 7 years ago

I haven't had a chance to test yet. I'm going to get back to it next week. I did test IE11 and Edge. Both work fine. Safari is fine. Need to test Chrome and Firefox on Windows. Chrome and Firefox on Mac are slow.

nhinze commented 7 years ago

I have finally upgraded my app. The loading can be a bit slow in Chrome, but the performance seems ok for now. For my app, I need to keep the smoothFactor at 1.

Thanks for you help. It's a great plugin!