Okay, ouch. Good point on the map changing.
What I meant was storing it o hard drive, if thats possible, each path has a 4 number adress: Xa,Ya, Xb, Yb. When a creature needs to go from Xa Ya to Xb Yb it looks up the path.
BAD point. Never, ever store things to hard drive when you're trying to make them faster. Hard drive is around the order of, what, a thousand times slower than RAM access? Maybe slower than that? It can read at a good clip if it's reading a big consecutive chunk, but put "hard drive" out of your head. It won't fly.
Assuming 2 GHz with IPC of 1 (instruction executed per cycle). with typical hard-drive random access rate of 5.6 milliseconds
Typical Hard-drive access: 1,000,000+ cycles
Typical memory access: 10~20 cycles
Typical L2 cache access: 2~5 cycles (depend on architecture)
Typical L1 cache access: 1~2 cycles (depend on architecture)
In short, you want all cached path to reside in L1 cache (typically 64 kB) and L2 cache (typically 1 MB).
Interesting thing of note. Memory access tend to be very fast if you access consecutive memory in a certain chunks (I think it's 64 bytes with starting addresses with lower 6 bits of zeros). However, since optimal memory read length is variable, the best bet is to keep data structures that need to be read frequently in powers of 2 blocks (16, 32, 64, 128, etc).
Of course, there's a condition called cache thrashing, which occurs when you access the memory in an interesting interval (every 64 bytes for example). So the best bet is try to avoid memory access (in short, when you starting working in a block of data, try to avoid touching another large block of data until your're done).
EDIT:
Of course, since the computer we use to run Dwarf Fortress is varied, Toady probably should not worry much about this. Beside, cache manager in modern processor is much more advanced and can now handle a lot of complicated memory access efficiently (even pre-caching).