Commit 59541d1
authored
Use independent seeds in makeSizedByteStrings (#7735)
* Use independent seeds in makeSizedByteStrings
`makeSizedByteStrings` used the same `H.Seed` for every element, so each
generated ByteString was a prefix of the same deterministic byte sequence.
Use `unfoldr (Just . Seed.split)` to produce a stream of independent
SplitMix seeds instead, giving uncorrelated content across sizes.
* Extract splitSeeds and apply to Text/Utf8 generators
`makeSizedTextStrings` and `makeSizedUtf8ByteStrings` had the same bug as
`makeSizedByteStrings`: they fmap'd a single seed across all sizes,
producing correlated string and decodeUtf8 benchmark inputs.
Extract the seed stream into a named top-level binding `splitSeeds` and
reuse it across all three sized-list helpers.1 parent 5f79449 commit 59541d1
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | | - | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
108 | | - | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
118 | | - | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| |||
0 commit comments