The fastest scripting language to use with Java

I would like to know the best (fastest) scripting language to use in Java. I don't care if it takes a long time to download (as long as it's a one-time download), unlike how fast it works. I am currently using Jython (python), but I would like something faster.

+4
source share
5 answers

There are already a lot of tests and discussions. Although I do not give a lot of loans (no) for benchmarking. The top 2 bidders (listed in order of speed):

  • Scala
  • Groovy ++

I tried both and they are not the same in my use cases. Scala came out much faster than groovy ++ (again, these are not my use cases and may not differ in your use cases). Scala was almost native java speed.

Groovy (not groovy ++), Closure, JRuby are all very slow. Groovy and JRuby run about 8 times slower on simple algorithms compared to Java versions, even after a decent amount of warm-up.

I cannot guarantee that you will receive the same numbers as me, but it would be a decent order to try them.

+4
source

Groovy is a very good scripting language that goes well with Java.

By saying this, Java can run any scripting language through the command line, or it can run any other program if you want to. Therefore, I would focus more on the Java side and more on the "fast" side.

Nothing prevents you from writing C ++ - a program for compiled code and calling it.

Also, what profiling tests have you done with Jython / python? How slow is it that doesn't meet your expectations? Does this cause problems? Is this possible in a python script?

+1
source

Have you tried programming in Java?

You can write some critical functions in Java and leave most of the code in the scripting language of your choice.

+1
source

Java, since version 7 supports regular compilation at runtime, if the SDK is on the way, javax.tools.JavaCompiler

0
source

LuaJIT https://github.com/gareins/dynamic_benchmarks

The above tests show that LuaJIT is very fast, but it still qualifies as a dynamic language.

0
source

Source: https://habr.com/ru/post/1347644/


All Articles