Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Java Performance Testing [duplicate]

  • SandeepKommineni
  • SandeepKommineni's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago - 6 years 6 months ago #158100 by SandeepKommineni
Java Performance Testing [duplicate] was created by SandeepKommineni
I want to do some timing tests on a Java application.

This is what I am currently doing:

long startTime = System.currentTimeMillis();

doSomething();

long finishTime = System.currentTimeMillis();

System.out.println("That took: "+(finishTime-startTime)+ " ms");
Is there anything "wrong" with performance testing like this? What is a better way?

Does anyone ever use stopwatch benchmarking, or should a
Code:
Don't spam : url removed
Performance Tuning tool always be used? Are there any good free tools available for Java? What tools do you use?

To clarify my concerns, stopwatch benchmarking is subject to error due to operating system scheduling. On a given run of your program the OS might schedule another process (or several) in the middle of the function you're timing. In Java things are even a little bit worse if you're trying to time a threaded application, as the JVM scheduler throws even a little bit more randomness into the mix.

How do you address operating system scheduling when benchmarking?
Last edit: 6 years 6 months ago by DenisChenu. Reason: Don't spam : url removed
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose