Strange counter-performance in an alternative `decimalLength9` function

Basile B. b2.temp at gmx.com
Wed Feb 26 23:09:34 UTC 2020


On Wednesday, 26 February 2020 at 20:44:31 UTC, Bruce Carneal 
wrote:
>> The winning function implementation lines up with that 
>> distribution.  It would not fare as well with higher entropy 
>> input.
>
> Using sorted equi-probable inputs (N 1 digit numbers, N 2 digit 
> numbers, ...) decimalLength9_0 beats a simple branchless 
> implementation by about 10%.
>
> After shuffling the input, branchless wins by 2.4X (240%).

I've replaced the input by the front of a rndGen (that pops for 
count times and starting with a custom seed) and I never see the 
decimalLength9_3 (which seems to be the closest to the original 
in term of performances) doing better.

Maybe you talked about another implementation of decimalLength9 ?


More information about the Digitalmars-d-learn mailing list