The big concern in pathfinding isn't getting to your destination, it's all the detours that the algorithm takes en route. So, to optimize pathfinding (assuming a heuristic system similar to A* - I seem to remember reading that Toady doesn't use A* directly):
* Ensure that major paths are straight lines through high-traffic areas.
* Avoid dead ends. If you have a workshop with only one entrance, the algorithm may enter the shop and explore every nook before backtracking out.
* Avoid the outdoors! Indoors, the walls help narrow the algorithm's search - outdoors, it can fan out over a wider area. This is especially important if there are bottlenecks out there, like a single bridge over a major river - the algorithm could cover huge chunks of the world before finding the bridge!
* When forced to go outdoors, remember the first point. Linear, high-traffic paths will take the least time. If you really want to be careful, consider a high-traffic route surrounded by restricted zones to keep the pathfinding contained. (Just don't expect your dwarves to path outside this range without difficulty!)
* Don't block paths! Locking a door is the obvious one - if a door is suddenly locked, the dwarves that were going through it have to re-compute. The game will also have to re-compute its connectivity map (which remembers which areas are connected - otherwise, an impossible path would first search the entire map before failing!), and the connectivity map is a pain to update.
* Keep workshop objects readily available. When a dwarf is in a workshop, he first finds the 'nearest' item - this algorithm expands out in a radius. If a Mason needs a stone, and the nearest stone is 7 tiles away, the game will search every tile within a 6-tile sphere first. That's a function of distance cubed. Sure, it happens less often, which is why this isn't the single biggest FPS drain... but it's worth optimizing, especially if you've got multiple high-efficiency dwarves working hard - they'll drain all the nearby resources quickly, and they'll force a lot of these inefficient searches later on.
Hopefully I haven't made any obvious mistakes here.