I have my water heater in the engine room, and in the summer, after running a while, engines are hot, then all the water is hot, even the cold water lines which run next to the hot water lines. I dont even need to turn on the water heater.
I dont really like that, cause if you take a shower it is all hot water and maybe too warm until it draws from the main tank, BUT the tank also sits in front of the generator which also heats that tank. I was thinking to put that insulation foam on the cold water pipes. Seeing it is a boat, you don't want to waste water running it to get to an even temp. I think putting some insulation on the pipes is going to make it better. I have copper pipe, and they conduct heat very well from the hot engine room air.