Electric water heaters work by way of ohmic heating elements. The elements can be changed. They come in different voltages & different watt ratings. Higher watt ratings & lower voltages use more amps. I commonly see 110vac & 220vac elements. Most are 220vac. Most elements run around 20-25 amps, but some run around 10 or a little less. Volts times Amps equals watts. A low watt element will take a long time to heat up a tank of water, even a small one. Once the tank is hot, it takes a lot less energy to keep it hot, unless you are in a very cold environment. If you have a very big house bank & a big inverter, this might be a possibility. If you have a gen set, this is a possibility. If you are plugged into shore power, this is the preferred method.
The heat exchangers on diesel motors get hot faster & work very well to produce very hot water. They are my choice for a boat on the hook. My diesel runs at 190 degrees F. When you buy a water heater, the control on it is normally limited to 120F to avoid scalding. Ron's comments about temperature regulatioin would seem to indicate prudent choices.
The propane insta-hot units work well on land, but I have yet to see a good installation in a boat.
A boat I am considering buying has an electric water heater in it. If I buy that boat, I will likely tear out that heater & only use the heat exchanger, once the boat is off the hard. My boats normally live on the hook. I have better things to do with that much space.