9. If $P(x, y)$ is a point on the hyperbola $\frac{x^{2}}{8}-\frac{y^{2}}{4}=1$, then the minimum value of $|x-y|$ is $\qquad$ .
Let $P(2 \sqrt{2} \sec \theta, 2 \tan \theta)$, then $|x-y|=2\left|\frac{\sqrt{2}-\sin \theta}{\cos \theta}\right| \geqslant 2$,
equality holds when $\sin \theta+\cos \theta=\sqrt{2} \Rightarrow \theta=\frac{\pi}{4} \Rightarrow P(4,2)$. Therefore, the minimum value of $|x-y|$ is 2.