You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Brian Sweeney <Br...@sas.com> on 2009/09/21 23:07:29 UTC

junit first samples slow

Hi guys,

I've been playing with different structures for my tests.  I have a single unit test under a thread group so the results are in a nice form for another tool.  I've set up the thread group to run the test 10 times and noticed the first run is usually about 200x slower than subsequent runs.  Has anyone seen this?  Is there a work-around?

I have an idea about how to fix this, but I'm hoping somebody else has addressed this already.  Thoughts?

Thanks,
Brian

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: junit first samples slow

Posted by sebb <se...@gmail.com>.
On 21/09/2009, Brian Sweeney <Br...@sas.com> wrote:
> Hi guys,
>
>  I've been playing with different structures for my tests.  I have a single unit test under a thread group so the results are in a nice form for another tool.  I've set up the thread group to run the test 10 times and noticed the first run is usually about 200x slower than subsequent runs.  Has anyone seen this?  Is there a work-around?
>
>  I have an idea about how to fix this, but I'm hoping somebody else has addressed this already.  Thoughts?

The JUnit sampler only includes the elapsed time for the method call
in the sample result, so any start-up overhead must be in the method
that is being called (not in setUp/tearDown). This is different from
JUnit3, which reports the overall time.

Note that a single sampler will re-use the same instance (within a
thread), which is deliberately different from the way JUnit behaves.
Different samplers use different instances, even if the same method is
being tested.

So you could see what happens if you have 10 separate samplers running
the same method.

The test class is not unloaded, so any class fields (static variables)
will remaind at the end of a test. If there is any one-time setup of
data this should show up if you re-rerun the test in the GUI without
exitting JMeter.


>  Thanks,
>  Brian
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org