What is the fastest language that runs on the JVM

What is the fastest language that runs on the JVM?

Scala? Groovy? Juby?

+6
performance jvm
source share
7 answers

See http://benchmarksgame.alioth.debian.org/ . Java is very fast, Scala is almost as fast. JRuby is 10-30 times slower. Groovy is too slow .

+12
source share

Java

Indeed, although, for the most part, the speed difference will be negligible. Static languages ​​will be faster than dynamic languages, but not by much.

+1
source share

According to Anthony, Java is the fastest language.

Languages ​​with static typing (Java, Scala) are faster than dynamic languages ​​(Groovy, JRuby).

+1
source share

You must be careful what you compare. Besides the fact that β€œit depends on what you do with it,” which others have talked about, it also depends on how you do it.

For example, a language like Scala might allow you to naturally express idioms and algorithms that you are likely to take a lot more in Java. This does not mean that you could not compare with the performance of Scala when doing the same thing - just to make it an ugly workaround in one language, to fit the natural idioms in another (note, I do not say that I really believe Scala faster than Java in something specific - I have no data about it - besides this Scala is designed with scalability in mind - hence the name).

In other words, performance is usually associated with algorithms, and often the choice of algorithms is associated with ease of expression. So here we use "using the right tools for the job" - is this tool Java, Scala, JRuby, etc. (Although I doubt that there are situations when a dynamic language is faster than a static language without being pathological).

Of course, we could also talk about profiling before optimization, etc., but this does not directly concern the issue.

+1
source share

I think it will depend on what you mean faster, and how well the language is written for performance.

For example, if you do something mathematical, then Scala will be faster than Java.

But if you avoid functions that are slow in java and use final in all places where it makes sense, you can get Java to work faster than Scala from what I was told recently during the interview.

So this is a tough question to answer in general terms, as people will show instances where Scala or Java will be faster.

But I believe that Scala will usually be faster if you do not use var s, and val instead.

-one
source share

Any language that compiles to bytecodes will work equally fast on JVMs with JIT.

-3
source share

All Articles