Moving - With Binary Heap Optimisation
The binary heap is only used whilst the algorithm is running, so we'll only be taking the movement statistics.
Frame time whilst moving (20x20 grid):
1/0.0013 = 769 fps
Frame time whilst moving (50x50 grid):
1/0.0025 = 400 fps
Frame time whilst moving (100x100 grid):
Frame time whilst moving (100x100 grid):
1/0.015 = 66 fps
As you can see, binary heap optimisation has roughly doubled performance, and has also made frame drops less noticeable at 50x50. The algorithm could be optimised further, but a more significant way to lower frame time is by changing the map representation.