On the spectral gap for compact manifolds