What does it depend on?
In terms of thermal efficiency alone, gas water heaters are the highest and of course the most economical.
The problem is very clear. Gas water heaters are significantly more cost-effective.
The water temperature is stable, there is less waste and it is cheaper to install and use.
I recommend the poster to buy Macro.