Asymptotic optimality of adaptive importance sampling