Class Profiler

java.lang.Object
com.landawn.abacus.util.Profiler

public final class Profiler extends Object
A simple way to run load/performance test.

Caution: if the loop number is too big, it may take a lot of memory to save the test result and impact the test result.
So instead of running the performance with big loop number:
 
 final int bigLoopNum = 1000_000;
 Profiler.run(threadNum, bigLoopNum, roundNum, "yourMethod", () -> yourMethod());
 

 // reduce the 'bigLoopNum' by for-loop:

 
 Profiler.run(threadNum, bigLoopNum / 1000, roundNum, "yourMethod", () ->
  {
      for (int i = 0; i < 1000; i++) {
          yourMethod();
      }
  });
 
 
Since:
0.8
Author:
Haiyang Li