engineHolder.get().invokeFunction("renderServer", comments) too slow
every execute this method elapsed about 1 minutes.
Maybe linked to https://bugs.openjdk.java.net/browse/JDK-8134403 ...
Didn't noticed such slow perf at the time coding this example. What Java Version do you use?
1.8.0_40-b25
Perf bug mentioned by @sdeleuze is fixed for 8u66. You could test with an older Java version like 8u31.
@winterbe thanks
I was interested to see what the performance was like. I also wanted to try out the CompiledScript. Here is a commit that tries a hundred runs as-is then a hundred runs as CompiledScript. Plotting output out of mvn test shows on my macbook pro an average runtime of 12.3ms for the original approach and 10.7 for the CompiledScript approach.