commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex D Herbert (JIRA)" <>
Subject [jira] [Commented] (RNG-88) Update the GenerationPerformance benchmark
Date Thu, 04 Apr 2019 11:15:00 GMT


Alex D Herbert commented on RNG-88:


Note that the example for a benchmark class has two {{@Benchmark}} methods to test JMH timing
overhead. These should sum to approximately the same metric as the BASELINE implementation.
In the above case for {{nextDouble()}} here are the results:
| |baselineDouble|2.3360076674923396|0.31171210270144445|2.26776285101707|0.133437962143361|
| |baselineVoid|0.2657420971315234|3.32183670742148E-4|0.265707936583524|0.00125002276390459|

baselineDouble + baselineVoid ~ BASELINE
2.33 + 0.27 ~ 2.57
This shows the baseline implementation is being run.

Note that the Error output by JMH is is the 0.999 percentile of the T-distribution with n-degrees
of freedom multiplied by the standard error of the mean. This is a conservative +/- limit
on the true value of the mean. Dividing the Error by the Score gives a quick check to see
if there is a lot of variation in the mean. 

In this example WELL_1024_A has a single measurement that is 16.5, which is above the usual
12.9 time. Hence using the median for analysis to avoid skew from single outliers.


> Update the GenerationPerformance benchmark
> ------------------------------------------
>                 Key: RNG-88
>                 URL:
>             Project: Commons RNG
>          Issue Type: Improvement
>          Components: examples
>    Affects Versions: 1.3
>            Reporter: Alex D Herbert
>            Assignee: Alex D Herbert
>            Priority: Minor
>         Attachments: baseline.jpg, next.png
>          Time Spent: 10m
>  Remaining Estimate: 0h
> The current GenerationPerformance benchmark runs all the generators to collect timing
data. However the act of running the test within JMH takes some time (test overhead). This
overhead should be measured and subtracted from the timing data to create a time attributed
only to the method exercised in the RNG.
> This can be done by creating a dummy RNG that returns a fixed value. The implementation
must be done in a manner where the JIT compiler is not able to remove the dummy method from
the execution path. This is achieved by returning state variables from the dummy RNG (not
final variables).
> Testing can be done using a variable number of iterations and the run-times assessed
for linearity. If the run time scale with the number of iterations then the JIT compiler has
not removed it from execution. The dummy RNG then serves as a baseline for comparison of true
> This idea with examples is shown in [RNG-87|]
which tested a variant of the MWC_256 algorithm.

This message was sent by Atlassian JIRA

View raw message