Ok, so as noted previously, Pathfinding is generally the biggest killer in older forts.
Each dwarf needs to find paths every time they want to go somewhere or get something. The costs here are (roughly):
1) Determine what object you want to get.
In forts with thousands of pieces of stone or other objects this can take a while, but people tend to make this out to be a bigger problem than it really is - large list searches can be quite fast. Nevertheless, designating a lot of your loose junk stone and other trash to be (F)orbidden can speed this up a bit.
2) Find a path to the object you want.
Ok, this is where things get really expensive. Anyone familiar with A* path routines knows that the bigger and more complex the search space, the uglier this gets, quickly. For those unfamiliar with A*, it works a little like filling the map with water, starting from the spot your dwarf is now, spreading out along
every available path until it the flow finally reaches the ONE spot you are looking for. Think about how you would restrict the flow of water flooding your fort, and do the same for pathing (ok, except this 'pathing' water flows up, down and in all directions).
Dwarf Fortress is actually pretty good about segmenting its pathing spaces to reduce costs - IF you help it out a bit. Pathing does not search through locked doors, or outside of burrows that a dwarf is assigned to.
-
Don't create too many different ways to get to the same place. A* will tend to search ALL of them to try and get there. Think in terms of efficiency - if your dwarves can get there efficiently, then A* will also tend to run more efficiently.
-
Think vertically. A lot of players have a tendency to build huge, sprawling horizontal labyrinths that take forever to get anywhere. Think in terms of building in a CUBIC format and you'll compress a 200x200 fortress that can take up to 300 steps to get from point A to point B, and reduce it to a 34x34x34 space that takes a maximum of about
50 steps to get anywhere. That's huge savings both for your Dwarves and A*. It's also an interesting challenge to force yourself to think in completely 3-dimensional terms.
-
Make your corridors wide enough to prevent congestion, but not any wider. 1-space corridors are fine for any infrequently travelled space, and 2-spaces fine for all but the most heavily trafficked. Wider than that just increases pathing costs without much benefit. I'll admit I often use 3-wide corridors for aesthetic reasons, but I know that I pay for that.
-
Isolate any unused sections of your fortress. And by that I mean your mines and storerooms. Most fortresses will choke to death the moment you start MASS MINING operations underground, digging tunnels through miles of rock in all directions. This is just
terrible for the poor pathfinder - but of course, you need to mine. Divide your mines into sections and seal those tunnels off with locked doors as you finish exploring and exploiting them. This will make a huge difference (it also puts all those loose rocks out of play). If your dwarf
can't get there, it's off the grid and you no longer pay the pathing costs for it.
-
Isolate Caverns. Opening caverns adds a huge new pathing space all in one go when you penetrate them. When you breach a cavern, create a walled and door-sealed section that your Dwarves are restricted to save for when you are actively exploring it. This knocks most of the cavern space off the path map, and also helps keep the giant monsters from reaching your fortress. Note that flying monsters eat up vastly more pathing time inside caverns because there is so much cubic volume for them to consider, but you can't do anything about that.
-
Doors, Doors, Doors Locked doors isolate useless rooms, seal off expensive alternate routes, and generally allow you a great deal of fast control over pathing. Use them. A lot.
Other MechanismsUsing the traffic designation tool causes the pathing 'flow' to spread much faster through your high traffic designations, and much slower through low traffic or restricted designations. This is good for reducing the cost increases that can be caused by creating alternate routes, but using them effectively requires a more robust understanding of A*, so again I suggest door management for most cases.
Burrows are a similarly powerful pathing restriction tool, as dwarves supposedly will try not to search for paths outside of them, but there are two problems, first, burrow assignment is still confusing as hell, and second, I'm not really sure that it restricts pathing enough to really make as much of a difference as doors or walls do. I just don't know enough about that system to judge it properly.