In my project I’m using standalone jasper implementation of EL. I added libs to my maven pom file:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>el-api</artifactId>
<version>6.0.32</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jasper-el</artifactId>
<version>6.0.32</version>
</dependency>
Currently my app is very slow because of heavy usage of el expressions – it’s compiling right in time it should be invoked.
Now I want to move expression compilation in initialization time but I wonder if it will be threadsafe to use same ValueExpression’s in multiple threads. Any thoughts?
Value expresion are not thread-safe. However, an EL implementation should cache parsed expressions internally and calling
ExpressionFactory.createExpression(...)should need to parse an expression string only at first time.Depending on your environment, you may want to try an EL implementation that performs better than Tomcat’s, e.g. JUEL could improve performance significantly.