Open asfimport opened 2 years ago
ko (migrated from Bugzilla): Created attachment 1639976054%281%29.png: Jsr223 preprocessor configuration
@FSchumacher (migrated from Bugzilla): Yes, that seems to be odd and I will look into it, but the real question for me is, why do you use Bean Shell and not the default, which is Groovy? (hint Groovy is on par performance wise and definitely nicer to deal with that Bean Shell)
@pmouawad (migrated from Bugzilla): Hello, Can you share the Test element script content ? Thansk
@FSchumacher (migrated from Bugzilla): In my tests, I used 'return "OK"' as the script content.
The Bean Shell sampler ticked at something about 50.000 req/s and the JSR223 Bean Shell at about 300 req/s.
The problem with JSR223 and Bean Shell seems to be, that the JSR223 implementation for Bean Shell is not getting cached/compiled and the compilation is extremely expensive (the parser seems to be using exceptions to control the flow of the parser and a class loader instance is set up for each run).
You can get Bean Shell sampler almost equally slow, if you check the box to reset Bean Shell on each iteration :)
I am not sure, whether it was faster in earlier versions of JMeter (I somehow doubt it), but I still wonder, why anyone would choose Bean Shell over Groovy.
@FSchumacher (migrated from Bugzilla): The attached test plan runs four different Hello World samplers against the clock. On my machine the BeanShell sampler is the fastest, followed by JSR 223 Groovy (not that much slower), JavaScript (quite a lot slower) and way off BeanShell (as JSR223).
It seems, that there is a newer version of BeanShell (2.1.0 according to https://github.com/beanshell/beanshell/releases) which implements JSR223 Compilable interface. Sadly, I didn't find the artefacts on any maven repo.
If you wish to test the new release of Beanshell for yourself, you can remove lib/bsh-2.0b6.jar and replace it with the bsh-2.1.0.jar. Then, you have to edit the file META-INF/services/javax.script.ScriptEngineFactory inside the jar to read bsh.BshScriptEngineFactory instead of bsh.engine.BshScriptEngineFactory. (Otherwise an error message is displayed on JMeter startup and no bsh can be found in the JSR223 sampler)
Created attachment bug65754-bsh-jsr-comparison.jmx: Test plan for comparison of BSH and JSR223 samplers
true
ko (Bug 65754): JMeter version 5.4.1 java version 1.8.0_161 Running environment windows10
Script as like as two peas, script script TPS 300+, BeanShell preprocessor script script, TPS 600+, script content is the same as jsr223 preprocessor.
Created attachment _%5DUF%5B%28MQ_E%404%5DMK%7EZVHR%60OA.png: Red box mark
Severity: normal OS: All