  We study the rate of convergence in periodic homogenization for convex
Hamilton--Jacobi equations with multiscales, where the Hamiltonian $H=H(x, y,
p): \mathbb{R}^n \times \mathbb{T}^n \times \mathbb{R}^n \to \mathbb{R }$
depends on both of the spatial variable and the oscillatory variable. In
particular, we show that for the Cauchy problem, the rate of convergence is
$O(\sqrt{\epsilon})$ by optimal control formulas, scale separations and curve
cutting techniques. We also show the rate $O(\sqrt{\epsilon})$ of
homogenization for the static problem based on the same idea. Additionally, we
provide examples that illustrate the rate of convergence for the Cauchy problem
is optimal.
