Astargrid2D performance

Godot Version

4.2

Question

Hello! I recently implemented the Astargrid2D into my game and with it came a lot of benefits to enemy navigation in my game. The problem is usually once per play session the FPS will take a dip from around 1200 to 1-36 ish for just a second and I’m assuming it’s because of the pathfinding since it didn’t do this before.

I am currently generating procedural tile-based levels which are fully destructible and setting new positions to be walkable every time a tile is removed. Could this be an issue? Or might it be the amount of enemies? Right the max enemies allowed in a level is 12 so I don’t think it should be so bad.

Any help would be much appreciated.