qiao / PathFinding.js

A comprehensive path-finding library for grid based games
http://qiao.github.io/PathFinding.js/visual/
8.42k stars 1.32k forks source link

Cloning grid #171

Open d0peCode opened 5 years ago

d0peCode commented 5 years ago

I don't know if it's intentional but due to cloning my grid (1000x1000) in loop and adding collisions also in loop searching closest path is taking more than few seconds which make's this library unusable in my case. But be aware I'm not hating, this is open source so thank you for sharing anyway.

Just wondering if there are plans to optimase performance of this library in future?

brean commented 5 years ago

Well, not this library (the original author has not touched it in some years) and for a proper solution the map needs to be resetted.

You could change the finder algorithm yourself and store all nodes that have been visited and only clear those but this requires of course more memory, so I am not sure, if that is always such a good idea.

There are also other libraries that are faster, easystar.js for example that is using asynchronous functions.