Java is very fast: https://github.com/gunnarmorling/1brc
I suspect Java is fast. JavaScript is also fast. They are both fast. Without comparing measures the only significant distinction between the two is the time to compile. In that case Java is slow, or at least just substantially slower than JavaScript.
Fortunately there are comparative benchmarks: The Programming Benchmark Games. It is not always the best, but it is certainly better than naught.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...