cristina-abad / vrodriguez

Code and documentation generated by Victor Rodriguez during his Research Project
0 stars 1 forks source link

Use JMH to benchmark sampling from Gaussian (Normal distribution) vs. EmpiricalDistribution #3

Open cristina-abad opened 8 years ago

cristina-abad commented 8 years ago

In our programs, we are sampling from EmpiricalDistribution (http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/random/EmpiricalDistribution.html). However, our code is currently very slow. One possible reason is that sampling from this distribution may be very inefficient. For this reason, we want to benchmark how long it takes to sample:

  1. 1000000 (one million) numbers using Java's default random generator
  2. 1000000 numbers from the Normal distribution (http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/NormalDistribution.html)
  3. 1000000 numbers from the Exponential distribution (http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/ExponentialDistribution.html)
  4. 1000000 samples from an EmpiricalDistribution with very few bins
  5. 1000000 samples from an EmpiricalDistribution with a large number of bins.

Victor: Ask Edwin Boza for two EmpiricalDistributions (one small and one large)

To close this Issue, I will need:

cristina-abad commented 8 years ago

Otros dos tutoriales: http://www.rationaljava.com/2015/02/jmh-how-to-setup-and-run-jmh-benchmark.html http://java-performance.info/jmh/

Y un buen ejemplo: http://stackoverflow.com/questions/81346/most-efficient-way-to-increment-a-map-value-in-java