Optimising AstarPath.cs


I’m getting performance spikes in my debugger for the AstarPath Update method. Here is a screenshot of the profiler.

How do I check what is going on here? I saw a similar post which you linked to the AstarDebugger, but the link is broken.


This is either a graph update (either manual or requested by the DynamicGridObstacle component) or navmesh cutting. Are you updating large areas of the graph?

Well I think its the DynamicGridObstacle because there are no manual updates aside from one. The game continues to spike for some reason. Here is a screenshot of the grid, to see what you think.

Are you using the ProceduralGridMover component by any chance? That could also be the source.

Yes I am using that. Is there any way to optimise it?

You could try the beta version. It has been optimized quite a lot in the beta. See A* Pathfinding Project

Thanks Ivé just installed it and seems to compile and everything. I broke some of my game though during optimization so should be busy for a few days, ill test it out soon as i can. Thanks for the help, i appreciate it.