Swimming goggles fog up because of condensation forming on the inside of the lenses. This is either perspiration or water vapour from your skin. Therefore, it is likely to be worse if you are exerting yourself.
If you wear glasses or contact lenses, of course we are going to say that the best thing to use in a swimming pool is a pair of prescription swimming goggles. But is this really necessary? Aren’t contact lenses just as good?