Skip to main content

2 posts tagged with "benchmarks"

View All Tags

Jactl Meets Apache Camel: Benchmarking camel-jactl

· 12 min read
James Crawford
Jactl Creator

camel-jactl is a new Apache Camel language module that lets you use Jactl as the scripting language inside Camel for things such as filter predicates, content-based routing rules, and message transformations. It registers itself through Camel's Language SPI under the name jactl.

import static io.jactl.camel.JactlLanguage.jactl;

from("direct:orders")
.filter(jactl("body.amount > 100 && body.status == 'NEW'"))
.to("direct:big-orders");

// Or via the Language SPI:
Language jactl = camelContext.resolveLanguage("jactl");
Predicate p = jactl.createPredicate("body.age > 20");
Expression e = jactl.createExpression("'Hello ' + body.name");

This post uses JMH benchmarks to compare the performance of Jactl against Camel's built-in Simple language and against Groovy (via camel-groovy) in the places where scripting languages typically appear in Camel applications, from single predicate evaluations up to a complete order-processing route, with a plain-Java route as the no-scripting baseline.

Jactl vs Groovy, JEXL, MVEL, and SpEL: A Performance Comparison

· 27 min read
James Crawford
Jactl Creator

This post presents the results of some representative benchmarks using the JMH benchmarking library to run comparative tests across the following five different Java-based scripting/expression languages:

LanguageVersionNotes
Jactl2.9.0Compiles to JVM bytecode
Groovy5.0.6Compiles to JVM bytecode
Apache Commons JEXL3.6.2AST interpreter
MVEL2.5.2AST interpreter with limited bytecode generation
Spring Expression Language (SpEL)5.3.39Hybrid expression tree/bytecode interpreter

Benchmarks were run on a Java 25.0.2 JVM

The benchmarks focus mostly on short, expression based tests, in an attempt to mirror the types of scenarios where scripting languages are often used (for example in rules processing systems). There is one longer benchmark with a script of around 30 lines, as well as benchmarks comparing the compilation speeds.