On 1/20/19 4:54 PM, Chet Ramey wrote: >> As an aside, I can confirm the findings of a performance difference >> between 4.4 and 5.0 when running the script provided earlier in the >> discussion. At first glance it seems to be due to the switch from the >> old LCG to the current MINSTD RNG, > > There's no switch: the bash-4.4 generator and bash-5.0 generators are > identical. I'll have to do some profiling when I get a chance.
So I ran a quick test. $ ./bash ./x3 iterations: 1000000 BASH_VERSION: 5.0.2(4)-maint time: 9.684 $ ../bash-5.0/bash ./x3 iterations: 1000000 BASH_VERSION: 5.0.0(1)-release time: 9.749 $ ../bash-5.0-patched/bash ./x3 iterations: 1000000 BASH_VERSION: 5.0.2(3)-release time: 9.840 $ ../bash-4.4-patched/bash ./x3 iterations: 1000000 BASH_VERSION: 4.4.23(7)-release time: 11.365 $ ../bash-4.4-patched/bash ./x3 iterations: 1000000 BASH_VERSION: 4.4.23(7)-release time: 11.235 jenna.local(1) Where the script is Eduardo's iterator that just expands $RANDOM N times. The random number generator has been the same since bash-4.0. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/