Performance. Good question. I don't know, I can only assume from what I know about how the jvm handles these situations in general.
I prefer to have external .jar-s in the lib, rather than copying the entire classes in the beanshell. This is especially the case when my classes already have dependencies of their own (you run into the issue of performance anyway, if it exists). It gets nasty very fast, especially with lots of code written. The decision is strictly related to maintainability. Beanshell is very flexible about how you define classes and new objects - that's already not performant itself, among other things beanshell does which are not top-notch performant. If you have this question about performance, then you probably want to add more code logic than you are recommended to (and usually more than it is really needed, this is obviously an assumption based on my own/colleagues mistakes). In large scale test scripts, my beanshell are lightweigth, i.e.: build a list of ids in a pre-processor and pass it to the sampler that needs to do a POST with a large list of entries for deletion; i.e.2: create a specific token that is done in whatever secure/custom fashion and cannot be obtained otherwise (and the request would fail if it is not sent correctly). Apart from beanshell and class loading performance issues, you will also have to deal with the performance of your own written code :) (this is why, my code is either written or reviewed by java devs)... See? things get nasty, use it only if you are sure you can't do it otherwise. --Adrian S On Wed, Sep 26, 2012 at 9:10 PM, lichen970 <[email protected]> wrote: > Thank you for your detailed response.I finally resolve my problem by using > vars.putObject(key,value) in beanshell. But I think what you suggest is > really helpful and I decide to have a try. > > At the same time, I wonder if you know the performance difference between > the two methods, namely import a customized class V.S. define and call > functions all in a beanshell pre/postprocessor? > > > > -- > View this message in context: > http://jmeter.512774.n5.nabble.com/advices-about-how-to-construct-beanshell-scripts-tp5714889p5714909.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
