I do not think this will help much with decreasing lag, though I do not know much of programming. It would though, make everything more realistic. A dwarf does not know whether the door it came trough would be closed once it has reached its destination, they now seem to magically know this.
Actually, it would. At the cost of DF using more RAM, though.
Let me explain by way of example:
Pathing is like writing a book.
Currently, every time a dwarf goes somewhere, a new book is written, containing the instructions where to go. At worst, every dwarf that goes to the same tile (think picking up the gifts the goblins left after their last siege), gets his own book of instruction.
Now, instead of writing a new book for everything, Dwarf Fortress stuffs books in a library. That way, the game can simply look up the book, and give it to the dwarf, instead of writing a new one.
This is obviously faster, even though it isn't as customizable as a personal book for every dwarf.
However, you could store lots of books, and discard the ones that are least used, before storage space runs out.
And if you turn books into an ecyclopedia of paths dwarfs take, the game can look up the encyclopedia (the ant trails: A specific area, for example the one where you fell the most trees, gather the most sand, fish the most fish, etc.), then the game only has to calculate the end of the path, since the dwarfs are already close to where they actually need to be.
It's quite possible that dwarfs won't use the most efficient path anymore, but that is sooo rarely needed, anyway, that I wouldn't be too concerned.
On another note, I've noticed that grass tiles that get pathed often (i.e. lots of dwarfs running around) "lose" the grass, creating a dirt path of sorts. That could be used to calculate common path ways already, I guess.