what you are discussing doing would be significantly more expensive, significantly less reliable, and of negligible thermodynamic improvement.
The on-demand water heaters are fairly good, however, they burn a LOT of natural gas, or power. The best solution, in my opinion, is a high efficiency condensing water heater combined with a waste water heat recovery unit. This system is less expensive and more efficient then a tankless/on demand unit.
__________________
|