Foam can be generated with the ocean modifier, but I don’t think you’ll have much control over it. You’ll probably want to use noise facs to mix the water shader with a diffuse/translucent foam shader for the general foam.
And for the raised foam, displacement. Since performance is a concern you may want to use a separate plane to avoid having to further subdivide the water because things may get slow.
Here is a quick node setup to get you started:
It’s a cube, a water plane, and a foam plane below it. For this work the foam plane needs an adaptive subsurf modifier and displacement set to “Displacement Only”.
In this example I used the cube origin to control the alpha because I’m lazy. The foundation of the alpha is a simple circular mask, so it won’t play well with objects of certain shapes nor will help with the water edge. You’ll want to handpaint a black-and-white mask to control it instead.
I also advise to replace the diffuse shader with a Principled one with transmission/SSS or a translucency mix to make it look really good. Also note part of the foam sits underwater and part doesn’t because it’s a flat plane. You’ll have to experiment and decide whether you’ll want to replicate part of water deformation, or use it directly in the water plane, etc so this doesn’t happen.
I hope this helps! 