[
https://issues.apache.org/jira/browse/RNG-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16852350#comment-16852350
]
Alex D Herbert commented on RNG-77:
-----------------------------------
For completeness here is the output from the ConstructionBenchmark for the
method *{{createByteArray}}*. This benchmark pre-constructs 500 byte array
seeds of the correct length for each random generator. The benchmark times the
construction cost when build using the *{{RandomSource.create(Object seed)}}*
method. Timings are the median from 5 runs; table sorted lexographically by RNG:
||randomSourceName||Before||After||Relative||Seed type||Size||
|ISAAC|3662.44|2248.72|0.61|int| 256|
|JDK|81.68|77.00|0.94|long | 1|
|KISS|86.12|64.34|0.75|int | 4|
|MT|10402.11|6666.25|0.64|int | 624|
|MT_64|5056.16|3551.98|0.70|long | 312|
|MWC_256|2204.56|713.68|0.32|int | 257|
|SPLIT_MIX_64|67.72|61.35|0.91|long | 1|
|TWO_CMRES|133642.02|132522.15|0.99|int | 1|
|WELL_512_A|181.12|79.00|0.44|int |16|
|WELL_1024_A|303.03|107.39|0.35|int |32|
|WELL_19937_A|5272.81|1202.08|0.23|int |624 |
|WELL_19937_C|5389.73|1205.77|0.22|int |624|
|WELL_44497_A|11394.47|2528.99|0.22|int |1391 |
|WELL_44497_B|11173.17|2528.37|0.23|int |1391 |
|XOR_SHIFT_1024_S|198.68|123.29|0.62|long |16 |
|XOR_SHIFT_1024_S_PHI|206.76|125.25|0.61|long |16 |
|XO_RO_SHI_RO_128_PLUS|122.37|59.92|0.49|long|4 |
|XO_RO_SHI_RO_128_SS|67.43|60.20|0.89|long |4 |
|XO_RO_SHI_RO_64_S|66.19|55.31|0.84|int|2 |
|XO_RO_SHI_RO_64_SS|69.65|55.71|0.80|int|2 |
|XO_SHI_RO_128_PLUS|82.73|59.85|0.72|int|4 |
|XO_SHI_RO_128_SS|81.44|59.18|0.73|int |4 |
|XO_SHI_RO_256_PLUS|88.56|71.30|0.81|long|4 |
|XO_SHI_RO_256_SS|88.53|67.98|0.77|long |4 |
|XO_SHI_RO_512_PLUS|123.03|84.92|0.69|long |8 |
|XO_SHI_RO_512_SS|123.20|84.96|0.69|long |8 |
Note: The data for XO_RO_SHI_RO_128_PLUS before is an outlier. Speed should be
similar to XO_RO_SHI_RO_128_SS.
So for any generator requiring an array the difference is noticeable when
constructing the generator from a byte seed.
The 5x speed improvement for int arrays seen in the conversion benchmark is
reflected for the WELL_44497 generators with a large int[] seed.
The 2x speed improvement for long arrays is close where the generator has no
internal seeding routine and the seed is large (XOR_SHIFT_1024_S_PHI).
> Update the NumberFactory conversion to and from byte arrays
> -----------------------------------------------------------
>
> Key: RNG-77
> URL: https://issues.apache.org/jira/browse/RNG-77
> Project: Commons RNG
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.3
> Reporter: Alex D Herbert
> Assignee: Alex D Herbert
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The {{ConstructionBenchmark}} in RNG-72 shows that constructing with a
> pre-computed native seed array but converted to a {{byte[]}} has a measurable
> slow down on the construction performance.
> This is a placeholder for an investigation into speeding up the methods for
> {{byte[]}} conversion in the {{NumberFactory}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)