rubenspgcavalcante / leaflet-ant-path

🌿🐜 Creates a leaflet polyline with a 'ant-path' animated flux
http://rubenspgcavalcante.github.io/leaflet-ant-path
MIT License
463 stars 80 forks source link

High CPU usage of chrome GPU #130

Open cojalvo opened 4 years ago

cojalvo commented 4 years ago

Type:

Environment:

I'm going to open a PR:

Description: Hi, leaflet-ant-path cause a high CPU usage of Chrome any idea why?

Wotuu commented 4 years ago

I want to bump this issue. This issue is a bit lackluster in details, but I too notice a lot of CPU usage while using this plugin. So much that I'm considering replacing it or getting rid of it entirely.

I'm using the plugin on https://keystone.guru/. Demo -> https://keystone.guru/bbzlbOX. CPU usage is 40 on my machine (according to Chrome Task Manager). I tinkered with it and most CPU usage is caused by the animated lines. If you for example check https://keystone.guru/yry94O3 you can see that without the animated lines it takes up a whole lot less CPU.

I can also notice it from your example site where CPU usage spikes up the moment you unpause the animated line https://rubenspgcavalcante.github.io/leaflet-ant-path/.

If you have any idea on how to further improve performance I'd be very happy to see them implemented! Thank you.