  We investigate local MCMC algorithms, namely the random-walk Metropolis and
the Langevin algorithms, and identify the optimal choice of the local step-size
as a function of the dimension $n$ of the state space, asymptotically as
$n\to\infty$. We consider target distributions defined as a change of measure
from a product law. Such structures arise, for instance, in inverse problems or
Bayesian contexts when a product prior is combined with the likelihood. We
state analytical results on the asymptotic behavior of the algorithms under
general conditions on the change of measure. Our theory is motivated by
applications on conditioned diffusion processes and inverse problems related to
the 2D Navier--Stokes equation.
