Minor points (not intended to take away from what has already been covered):How often a re-path is attempted and the distance to the target is important to recognizing when pathfinding is a problem.
So, most creatures stuck in trees don't cause heavy FPS loss because their re-path attempt ends in a few tiles and they do not attempt to re-path that often (citizens will idle for some time when stuck and kids will even Play, and will not enter climb mode until they enter combat or hit starvation/dehydration). Previous DF versions had a problem with pets and pet-locked doors, because pets attempt to re-path very often to their owner and the re-path distance to the owner could become long, and it would fail immediately and restart.
Creatures that cause big FPS hits are the ones that attempt to re-path often over long-distances, like FBs who are willing to re-path hundreds of tiles through different caverns to get into your fort. They will test all the possible paths to create a couple hundred tile path, then be interrupted and need to re-path. Flying creatures can also do horrible things to FPS in the right circumstances.