I have stated it many times before.
The correction for mining is to path from the squared to be mined to the miner. Reverse the path, and remove the final step.
I don't understand the need for the initial switch and later reversal. Unless that's your way of getting around the destination being normally unroutable-to.
Correcting item usage is a little more complex. The first step to do it is to make the item chosen by its distance from the workshop instead of the dwarf.
If it weren't a matter of having to find multiple destinations (or reverse routes from multiple start-points) a future improvement might be that while a particular object might be tentatively reserved for a task, as each and every job comes up the nearest object (or one that results in the shortest total path, via the point of collection) that is the
exact same type of item is used (any tentative reservation applied to that one switched over for later optomisation). More advanced versions controls might even allow (frexample) "any bed" or "bed of this quality or greater" or even "bed of greatest quality" to be auto-substituted.
(Nope,
way too much processor cycles involved in that, unless enough drastic improvements can be made with the whole routines that such extravagance can be bowed down to. Really, not a serious suggestion, just a wild musing...
)
Of course, right now you can deliberately use the ability to choose specific materials to prioritise their movement out of newly-dug areas that one wants to make inaccessible as soon as they're cleared, and I'm sure everyone would want to retain
this particular ability as an option. (Hey, adding "get furthest stone of any kind that you can find" could be a well-used option, to enhance the gathering-in speed.) Though the current masters of resource allocation can doubtless engineer these things this way already, by judicious mass allocation and deallocation
I have detailed the logic for both of these in quite a few posts. I won't repeat it all again, but both changes should be very easy to implement as long as it is only those small logic changes. Each would have a significant impact in dwarven efficiency, without actually reducing FPS.
Unlike most of my ideas in this post, which are fanciful at best!