AStar speed optimization.