4. Among the following four numbers, the largest is ( ).
(A) $\ln \sqrt{2}$
(B) $\frac{1}{\mathrm{e}}$
(C) $\frac{\ln \pi}{\pi}$
(D) $\frac{\sqrt{10} \ln 10}{20}$
4. B.
Consider the function $f(x)=\frac{\ln x}{x}$.
Then the four options are $f(2)$, $f(\mathrm{e})$, $f(\pi)$, and $f(\sqrt{10})$.

Also, $f^{\prime}(x)=\frac{1-\ln x}{x^{2}}$, so $f(x)$ is monotonically increasing on the interval $(0, \mathrm{e})$ and monotonically decreasing on the interval $(\mathrm{e},+\infty)$.

Therefore, the maximum value of $f(x)$ on the interval $(0,+\infty)$ is $f(\mathrm{e})$.