Edit: After I left, I realized this is a case of the classic flier problem where creatures can't fly over channeled squares when they have a specific place they want to go across the gap. Still, since the only farm bird it happens to is the goose, I think it's worth posting.
Second edit: My FPS problem returned, and this time it's not the geese. Oh well. Still, the geese won't path properly when they can't find a walkable path, even though their natural wandering will lead them to fly to all sorts of inappropriate places.
The problem and solution:
I designed a 4-z shaft in the middle of my recreation hall to surround an unmined adamantine vein I'm saving for aesthetic purposes. It winds around a bit, and I made the circle narrow enough that the vein intersects the walkway around it in a few places, but the vein itself is entirely untouched. All other stone around it has been removed so it can be worshiped by my dwarves.
This means I left some "platforms" on the vein where I didn't channel away the adamantine on the level below, with no ground path to the promenade. For some reason, my geese would fly there to rest (I had placed a meeting zone covering the entire room and I don't like the micromanagement of pastures). Only geese would do this; I brought breeding pairs of turkeys, peafowl, chickens, guineafowl and ducks as well, and none of them ever flew there. What ended up happening was I had at least 6-7 geese sitting on that ledge, possibly more by the end.
Last night, some time after I had mined the last connection away from that walkable space on top of the adamantine vein, my FPS started to get some major downwards spikes. Everything would be fine, with over 50 FPS for 2-5 second intervals, and then suddenly there would be a total freeze for anywhere from a fraction of a second to over a minute at a time (!).
I had no idea what was doing it; I thought perhaps it was the forgotten beasts I had, er, forgotten about in the sealed cavern layers, or maybe surface goblins or doomed traders trying to path into my airtight fort (no depot built). I knew it wasn't item count, as my 15000 stone (slowly being atom smashed away) was nowhere near the 60k stone I had a few forts ago before I realized I should have built an atom smasher, and in that terribly inefficient fort was only as low as 20-25 FPS. I guessed it was the animals, since I had let every type of bird breed once and my puppy army was starting to reach a respectable size (200 animals total...) so I started to cull them more aggressively, down to only one breeding pair of each animal type again. I wondered if it was liquid flow, but I hadn't fooled with liquids at all yet, and there was no preexisting liquid anomaly in the fortress.
Then I removed the meeting zone from the adamantine temple chamber. After a few minutes, almost all the birds and puppies had left the room... except for the geese on that ledge. This seemed very strange; they weren't there when I removed the floor leading to that ledge, so they must have flown onto it. Yet they were not able to fly off of it.
I built a walkway leading to the ledge and there were no more FPS freezes whatsoever; all the geese slowly pathed away. I've had smooth performance continually since this point. Still culling animals and smashing stone, but I'm no longer confused as to what was happening.
Edit: It was either a coincidence, or some other trouble the last two geese I have are getting into (unlikely), since the FPS problem has returned. Going through my troubleshooting now to see.
To sum up: Geese (and only geese) that flew to an unwalkable spot were unable to fly off, even though they flew there in the first place. This appeared to caused immense FPS problems, probably because they were a brain tumor in the pathing algorithm.
Picture:
Green = built path to solve problem, Red = problematic ledge with a few geese who hadn't yet finished walking off
Notes:
I checked the raws, and geese are the only animals in creature_domestic.txt that have the [FLIER] tag.
I don't know if this behavior would happen if I had instead defined a pasture over an unwalkable ledge, if I had made a locked or pet impassable door the only entry to an otherwise walkable area in a meeting zone or pasture overlapping the ledge, if I had made no meeting zones whatsoever (defaults to the wagon area?), or any other circumstance.
I had one additional meeting zone neither overlapping any unwalkable ledges nor the problematic meeting zone.
No dwarves were scheduled to interact with the geese on the ledge for almost all of the time I was having FPS problems/almost all of the time geese were there.
There were multiple unclaimed nest boxes used for omelette purposes outside of the meeting zone one Z level above the unwalkable area (on the promenade ring above). A quick stockpile check after freeing the geese reveals only 38 goose eggs and anywhere from 137 to 516 eggs of each other type of bird, suggesting geese were not laying (m)any eggs while they were "trapped."
I will be reporting this in the bug tracker as well. Has anyone else observed buggy goose behavior, or similar severe pathing problems with flying pets or untamed animals?