r/java 7d ago

Java Embedded Scripting Languages Benchmark: Jactl, Groovy, MVEL, JEXL, and SpEL

https://jactl.io/blog/2026/07/14/scripting-language-benchmarks

Jactl is an embeddable scripting language for Java applications and so when comparing it to other Java scripting languages it is helpful to know how they all compare from a performance point of view.

I have previously been asked to compare Jactl with MVEL and JEXL so I have put together a blog that documents the performance differences and also included Groovy and SpEL for good measure.

Disclaimer: I am the author of Jactl so I am obviously not impartial but I would like to point out that while Jactl comes out well, it does not win every benchmark.

34 Upvotes

19 comments sorted by

8

u/persicsb 7d ago

SpEL, JEXL and the other expression languages are not scripting.

8

u/jaccomoc 7d ago

I agree that SpEL is an expression language rather than a scripting language but JEXL, while originally starting as an expression language, has evolved into a proper scripting language with loops, variables, functions, and even lambdas.

3

u/East-Association-421 7d ago

I wonder where Janino fits into this picture

1

u/jaccomoc 7d ago

That would make an interesting comparison, particular when comparing compiled languages. Presumably it should be able to run at native Java speed but it would be interesting to find out...

7

u/chabala 7d ago

From the title, I would have expected a comparison of all the JSR-233 scripting languages: https://github.com/apache/commons-bsf/blob/master/src/main/resources/org/apache/bsf/Languages.properties

1

u/jaccomoc 7d ago

Thanks for that link. Something to look into.

2

u/chabala 7d ago

Is Jactl a JSR-233 compatible scripting language? It'd be cooler if it was 😎

2

u/jaccomoc 7d ago edited 7d ago

Yes, it is JSR-223 compatible: Jactl support for JSR-223

3

u/hippydipster 7d ago

I remember implementing expression values in JMeter and letting users write groovy expressions inside their values, and I thought it was so cool and let's support expressions in EVERY field, and then people came and loved it and demanded their favorite scripting and expression language be supported and so it had to support groovy and BeanShell and JEXL2 and JEXL3 and javascript and I hated life then.

1

u/jaccomoc 7d ago

That sounds like hell. What about just providing JSR223 support and leaving the language choice up to the users? Would that have worked?

3

u/hippydipster 7d ago

Well, my time as JMeter maintainer ended in 2005. Also the expressions I mean are just like little snippets that are embedded in any text value field - including the name of a component if one likes, so they're embedded with a syntax like ${...}. Nowadays, there is a JSR223 component in JMeter, but that is for writing a whole script that behaves like a controller, or sampler, or listener or whatever, so you can basically write your own JMeter plugin as a script in a particular test plan.

2

u/quantum-fudge 7d ago

Just out of curiosity, does anyone know what does MV in MVEL/MVFLEX stand for?

2

u/jaccomoc 7d ago

No idea. I think the original developer was Mike Brock so maybe "Mike's Value Expression Language"?

2

u/agentoutlier 7d ago edited 7d ago

Since expression languages are being used maybe this one is worth benchmarking as well: https://github.com/ezylang/EvalEx

as well as CEL: https://github.com/cel-expr/cel-java

And this might be interesting as well for Turing complete: https://github.com/reborg/jscheme

Which is Peter Norvig's original Java Scheme implementation.

1

u/jaccomoc 7d ago

I will have a look at them.

1

u/RussianMadMan 7d ago

Comparing compiled vs interpreted is not very useful in general and in this case it's just number padding.

4

u/jaccomoc 7d ago

I was asked to specifically compare against MVEL and JEXL but I also included Groovy and SpEL to also compare with compiled languages.

2

u/Jonjolt 7d ago

That was me lol

1

u/jaccomoc 7d ago

Sorry it took so long to get around to it. :-)