Check for air leaks first.
Cavitation is almost always a suction-side air leak or low water level, not a pump problem.
The pump is sucking air somewhere between the skimmer and the pump intake. That air bubbles through the impeller, sounds like rocks in a blender, and slowly destroys the pump. Usually, it’s a loose pump lid o-ring, a crack in the suction pipe, or the skimmer weir stuck open. Water level too low also lets air in.
Check those before you touch the pump itself. Replace the o-ring, clean the basket lid, and make sure the skimmer is operating right. If that doesn’t fix it, get a smoke test or listen for whistling along the pipe.
A quiet pump means no cavitation.