I'm making a large scale game at the moment with a very large layout (16k x 16k). So far everything is running smoothly, but I notice now that I've added pathfinding to one enemy type, when the enemy is loaded into RAM for the first time, if the pathfinding is enabled on the sprite, it hangs for a few seconds. Then all of created sprites afterwards load instantly and everything is fine. If I turn off "enabled" on the sprite and load it for the first time, there is no fps hang.
I've tried setting obstacles to custom, and that seems to have helped, but there is still a small stutter on creation. Being that most of the enemies in this game will have some sort of pathfinding, is there a reason this is happening? Currently there aren't a lot of objects in the game (just 1 tilemap and maybe 100-200 sprites for testing purposes).