github.com/xaionaro-go/rand@v0.0.0-20191005105903-aba1befc54a5/mathrand/read_autogenerated_test.go (about) 1 package mathrand_test 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 "github.com/xaionaro-go/rand/mathrand" 8 ) 9 10 // This file was automatically generated by github.com/xaionaro-go/rand/internal/autogen 11 12 func TestReadUint64AddRotateMultiply(t *testing.T) { 13 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddRotateMultiply) 14 prng := mathrand.NewWithSeed(initialSeed) 15 prepareSample( 16 "Uint64AddRotateMultiply", 17 prng.ReadUint64AddRotateMultiply, 18 false, 19 ) 20 } 21 func BenchmarkReadUint64AddRotateMultiply1(b *testing.B) { 22 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiply, 1) 23 } 24 func BenchmarkReadUint64AddRotateMultiply16(b *testing.B) { 25 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiply, 16) 26 } 27 func BenchmarkReadUint64AddRotateMultiply1024(b *testing.B) { 28 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiply, 1024) 29 } 30 func BenchmarkReadUint64AddRotateMultiply65536(b *testing.B) { 31 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiply, 65536) 32 } 33 func BenchmarkReadUint64AddRotateMultiply65536Concurrent(b *testing.B) { 34 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiply, 65536) 35 } 36 37 func TestXORReadUint64AddRotateMultiply(t *testing.T) { 38 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply) 39 prng := mathrand.NewWithSeed(initialSeed) 40 prepareSample( 41 "XORUint64AddRotateMultiply", 42 prng.ReadUint64AddRotateMultiply, 43 false, 44 ) 45 } 46 func BenchmarkXORReadUint64AddRotateMultiply1(b *testing.B) { 47 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply, 1) 48 } 49 func BenchmarkXORReadUint64AddRotateMultiply16(b *testing.B) { 50 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply, 16) 51 } 52 func BenchmarkXORReadUint64AddRotateMultiply1024(b *testing.B) { 53 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply, 1024) 54 } 55 func BenchmarkXORReadUint64AddRotateMultiply65536(b *testing.B) { 56 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply, 65536) 57 } 58 func BenchmarkXORReadUint64AddRotateMultiply65536Concurrent(b *testing.B) { 59 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply, 65536) 60 } 61 62 func TestReadUint64AddRotateMultiplyWithReseed(t *testing.T) { 63 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddRotateMultiplyWithReseed) 64 prng := mathrand.NewWithSeed(initialSeed) 65 prepareSample( 66 "Uint64AddRotateMultiplyWithReseed", 67 prng.ReadUint64AddRotateMultiplyWithReseed, 68 true, 69 ) 70 a := make([]byte, 65536) 71 b := make([]byte, 65536) 72 mathrand.GlobalPRNG.ReadUint64AddRotateMultiply(a) 73 mathrand.GlobalPRNG.ReadUint64AddRotateMultiply(b) 74 assert.NotEqual(t, a, b) 75 } 76 func BenchmarkReadUint64AddRotateMultiplyWithReseed1(b *testing.B) { 77 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiplyWithReseed, 1) 78 } 79 func BenchmarkReadUint64AddRotateMultiplyWithReseed16(b *testing.B) { 80 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiplyWithReseed, 16) 81 } 82 func BenchmarkReadUint64AddRotateMultiplyWithReseed1024(b *testing.B) { 83 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiplyWithReseed, 1024) 84 } 85 func BenchmarkReadUint64AddRotateMultiplyWithReseed65536(b *testing.B) { 86 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiplyWithReseed, 65536) 87 } 88 func BenchmarkReadUint64AddRotateMultiplyWithReseed65536Concurrent(b *testing.B) { 89 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateMultiplyWithReseed, 65536) 90 } 91 92 func TestXORReadUint64AddRotateMultiplyWithReseed(t *testing.T) { 93 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiplyWithReseed) 94 prng := mathrand.NewWithSeed(initialSeed) 95 prepareSample( 96 "XORUint64AddRotateMultiplyWithReseed", 97 prng.ReadUint64AddRotateMultiplyWithReseed, 98 true, 99 ) 100 a := make([]byte, 65536) 101 b := make([]byte, 65536) 102 mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply(a) 103 mathrand.GlobalPRNG.XORReadUint64AddRotateMultiply(b) 104 assert.NotEqual(t, a, b) 105 } 106 func BenchmarkXORReadUint64AddRotateMultiplyWithReseed1(b *testing.B) { 107 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiplyWithReseed, 1) 108 } 109 func BenchmarkXORReadUint64AddRotateMultiplyWithReseed16(b *testing.B) { 110 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiplyWithReseed, 16) 111 } 112 func BenchmarkXORReadUint64AddRotateMultiplyWithReseed1024(b *testing.B) { 113 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiplyWithReseed, 1024) 114 } 115 func BenchmarkXORReadUint64AddRotateMultiplyWithReseed65536(b *testing.B) { 116 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiplyWithReseed, 65536) 117 } 118 func BenchmarkXORReadUint64AddRotateMultiplyWithReseed65536Concurrent(b *testing.B) { 119 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateMultiplyWithReseed, 65536) 120 } 121 122 func TestReadUint64AddNRotateMultiply(t *testing.T) { 123 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply) 124 prng := mathrand.NewWithSeed(initialSeed) 125 prepareSample( 126 "Uint64AddNRotateMultiply", 127 prng.ReadUint64AddNRotateMultiply, 128 false, 129 ) 130 } 131 func BenchmarkReadUint64AddNRotateMultiply1(b *testing.B) { 132 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply, 1) 133 } 134 func BenchmarkReadUint64AddNRotateMultiply16(b *testing.B) { 135 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply, 16) 136 } 137 func BenchmarkReadUint64AddNRotateMultiply1024(b *testing.B) { 138 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply, 1024) 139 } 140 func BenchmarkReadUint64AddNRotateMultiply65536(b *testing.B) { 141 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply, 65536) 142 } 143 func BenchmarkReadUint64AddNRotateMultiply65536Concurrent(b *testing.B) { 144 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply, 65536) 145 } 146 147 func TestXORReadUint64AddNRotateMultiply(t *testing.T) { 148 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply) 149 prng := mathrand.NewWithSeed(initialSeed) 150 prepareSample( 151 "XORUint64AddNRotateMultiply", 152 prng.ReadUint64AddNRotateMultiply, 153 false, 154 ) 155 } 156 func BenchmarkXORReadUint64AddNRotateMultiply1(b *testing.B) { 157 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply, 1) 158 } 159 func BenchmarkXORReadUint64AddNRotateMultiply16(b *testing.B) { 160 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply, 16) 161 } 162 func BenchmarkXORReadUint64AddNRotateMultiply1024(b *testing.B) { 163 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply, 1024) 164 } 165 func BenchmarkXORReadUint64AddNRotateMultiply65536(b *testing.B) { 166 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply, 65536) 167 } 168 func BenchmarkXORReadUint64AddNRotateMultiply65536Concurrent(b *testing.B) { 169 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply, 65536) 170 } 171 172 func TestReadUint64AddNRotateMultiplyWithReseed(t *testing.T) { 173 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiplyWithReseed) 174 prng := mathrand.NewWithSeed(initialSeed) 175 prepareSample( 176 "Uint64AddNRotateMultiplyWithReseed", 177 prng.ReadUint64AddNRotateMultiplyWithReseed, 178 true, 179 ) 180 a := make([]byte, 65536) 181 b := make([]byte, 65536) 182 mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply(a) 183 mathrand.GlobalPRNG.ReadUint64AddNRotateMultiply(b) 184 assert.NotEqual(t, a, b) 185 } 186 func BenchmarkReadUint64AddNRotateMultiplyWithReseed1(b *testing.B) { 187 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiplyWithReseed, 1) 188 } 189 func BenchmarkReadUint64AddNRotateMultiplyWithReseed16(b *testing.B) { 190 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiplyWithReseed, 16) 191 } 192 func BenchmarkReadUint64AddNRotateMultiplyWithReseed1024(b *testing.B) { 193 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiplyWithReseed, 1024) 194 } 195 func BenchmarkReadUint64AddNRotateMultiplyWithReseed65536(b *testing.B) { 196 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiplyWithReseed, 65536) 197 } 198 func BenchmarkReadUint64AddNRotateMultiplyWithReseed65536Concurrent(b *testing.B) { 199 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddNRotateMultiplyWithReseed, 65536) 200 } 201 202 func TestXORReadUint64AddNRotateMultiplyWithReseed(t *testing.T) { 203 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiplyWithReseed) 204 prng := mathrand.NewWithSeed(initialSeed) 205 prepareSample( 206 "XORUint64AddNRotateMultiplyWithReseed", 207 prng.ReadUint64AddNRotateMultiplyWithReseed, 208 true, 209 ) 210 a := make([]byte, 65536) 211 b := make([]byte, 65536) 212 mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply(a) 213 mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiply(b) 214 assert.NotEqual(t, a, b) 215 } 216 func BenchmarkXORReadUint64AddNRotateMultiplyWithReseed1(b *testing.B) { 217 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiplyWithReseed, 1) 218 } 219 func BenchmarkXORReadUint64AddNRotateMultiplyWithReseed16(b *testing.B) { 220 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiplyWithReseed, 16) 221 } 222 func BenchmarkXORReadUint64AddNRotateMultiplyWithReseed1024(b *testing.B) { 223 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiplyWithReseed, 1024) 224 } 225 func BenchmarkXORReadUint64AddNRotateMultiplyWithReseed65536(b *testing.B) { 226 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiplyWithReseed, 65536) 227 } 228 func BenchmarkXORReadUint64AddNRotateMultiplyWithReseed65536Concurrent(b *testing.B) { 229 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddNRotateMultiplyWithReseed, 65536) 230 } 231 232 func TestReadUint64MultiplyAdd(t *testing.T) { 233 //testRead(t, mathrand.GlobalPRNG.ReadUint64MultiplyAdd) 234 prng := mathrand.NewWithSeed(initialSeed) 235 prepareSample( 236 "Uint64MultiplyAdd", 237 prng.ReadUint64MultiplyAdd, 238 false, 239 ) 240 } 241 func BenchmarkReadUint64MultiplyAdd1(b *testing.B) { 242 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAdd, 1) 243 } 244 func BenchmarkReadUint64MultiplyAdd16(b *testing.B) { 245 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAdd, 16) 246 } 247 func BenchmarkReadUint64MultiplyAdd1024(b *testing.B) { 248 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAdd, 1024) 249 } 250 func BenchmarkReadUint64MultiplyAdd65536(b *testing.B) { 251 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAdd, 65536) 252 } 253 func BenchmarkReadUint64MultiplyAdd65536Concurrent(b *testing.B) { 254 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAdd, 65536) 255 } 256 257 func TestXORReadUint64MultiplyAdd(t *testing.T) { 258 //testRead(t, mathrand.GlobalPRNG.XORReadUint64MultiplyAdd) 259 prng := mathrand.NewWithSeed(initialSeed) 260 prepareSample( 261 "XORUint64MultiplyAdd", 262 prng.ReadUint64MultiplyAdd, 263 false, 264 ) 265 } 266 func BenchmarkXORReadUint64MultiplyAdd1(b *testing.B) { 267 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAdd, 1) 268 } 269 func BenchmarkXORReadUint64MultiplyAdd16(b *testing.B) { 270 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAdd, 16) 271 } 272 func BenchmarkXORReadUint64MultiplyAdd1024(b *testing.B) { 273 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAdd, 1024) 274 } 275 func BenchmarkXORReadUint64MultiplyAdd65536(b *testing.B) { 276 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAdd, 65536) 277 } 278 func BenchmarkXORReadUint64MultiplyAdd65536Concurrent(b *testing.B) { 279 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAdd, 65536) 280 } 281 282 func TestReadUint64MultiplyAddWithReseed(t *testing.T) { 283 //testRead(t, mathrand.GlobalPRNG.ReadUint64MultiplyAddWithReseed) 284 prng := mathrand.NewWithSeed(initialSeed) 285 prepareSample( 286 "Uint64MultiplyAddWithReseed", 287 prng.ReadUint64MultiplyAddWithReseed, 288 true, 289 ) 290 a := make([]byte, 65536) 291 b := make([]byte, 65536) 292 mathrand.GlobalPRNG.ReadUint64MultiplyAdd(a) 293 mathrand.GlobalPRNG.ReadUint64MultiplyAdd(b) 294 assert.NotEqual(t, a, b) 295 } 296 func BenchmarkReadUint64MultiplyAddWithReseed1(b *testing.B) { 297 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAddWithReseed, 1) 298 } 299 func BenchmarkReadUint64MultiplyAddWithReseed16(b *testing.B) { 300 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAddWithReseed, 16) 301 } 302 func BenchmarkReadUint64MultiplyAddWithReseed1024(b *testing.B) { 303 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAddWithReseed, 1024) 304 } 305 func BenchmarkReadUint64MultiplyAddWithReseed65536(b *testing.B) { 306 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAddWithReseed, 65536) 307 } 308 func BenchmarkReadUint64MultiplyAddWithReseed65536Concurrent(b *testing.B) { 309 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64MultiplyAddWithReseed, 65536) 310 } 311 312 func TestXORReadUint64MultiplyAddWithReseed(t *testing.T) { 313 //testRead(t, mathrand.GlobalPRNG.XORReadUint64MultiplyAddWithReseed) 314 prng := mathrand.NewWithSeed(initialSeed) 315 prepareSample( 316 "XORUint64MultiplyAddWithReseed", 317 prng.ReadUint64MultiplyAddWithReseed, 318 true, 319 ) 320 a := make([]byte, 65536) 321 b := make([]byte, 65536) 322 mathrand.GlobalPRNG.XORReadUint64MultiplyAdd(a) 323 mathrand.GlobalPRNG.XORReadUint64MultiplyAdd(b) 324 assert.NotEqual(t, a, b) 325 } 326 func BenchmarkXORReadUint64MultiplyAddWithReseed1(b *testing.B) { 327 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAddWithReseed, 1) 328 } 329 func BenchmarkXORReadUint64MultiplyAddWithReseed16(b *testing.B) { 330 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAddWithReseed, 16) 331 } 332 func BenchmarkXORReadUint64MultiplyAddWithReseed1024(b *testing.B) { 333 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAddWithReseed, 1024) 334 } 335 func BenchmarkXORReadUint64MultiplyAddWithReseed65536(b *testing.B) { 336 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAddWithReseed, 65536) 337 } 338 func BenchmarkXORReadUint64MultiplyAddWithReseed65536Concurrent(b *testing.B) { 339 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64MultiplyAddWithReseed, 65536) 340 } 341 342 func TestReadUint64AddRotate(t *testing.T) { 343 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddRotate) 344 prng := mathrand.NewWithSeed(initialSeed) 345 prepareSample( 346 "Uint64AddRotate", 347 prng.ReadUint64AddRotate, 348 false, 349 ) 350 } 351 func BenchmarkReadUint64AddRotate1(b *testing.B) { 352 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotate, 1) 353 } 354 func BenchmarkReadUint64AddRotate16(b *testing.B) { 355 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotate, 16) 356 } 357 func BenchmarkReadUint64AddRotate1024(b *testing.B) { 358 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotate, 1024) 359 } 360 func BenchmarkReadUint64AddRotate65536(b *testing.B) { 361 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotate, 65536) 362 } 363 func BenchmarkReadUint64AddRotate65536Concurrent(b *testing.B) { 364 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddRotate, 65536) 365 } 366 367 func TestXORReadUint64AddRotate(t *testing.T) { 368 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddRotate) 369 prng := mathrand.NewWithSeed(initialSeed) 370 prepareSample( 371 "XORUint64AddRotate", 372 prng.ReadUint64AddRotate, 373 false, 374 ) 375 } 376 func BenchmarkXORReadUint64AddRotate1(b *testing.B) { 377 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotate, 1) 378 } 379 func BenchmarkXORReadUint64AddRotate16(b *testing.B) { 380 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotate, 16) 381 } 382 func BenchmarkXORReadUint64AddRotate1024(b *testing.B) { 383 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotate, 1024) 384 } 385 func BenchmarkXORReadUint64AddRotate65536(b *testing.B) { 386 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotate, 65536) 387 } 388 func BenchmarkXORReadUint64AddRotate65536Concurrent(b *testing.B) { 389 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotate, 65536) 390 } 391 392 func TestReadUint64AddRotateWithReseed(t *testing.T) { 393 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddRotateWithReseed) 394 prng := mathrand.NewWithSeed(initialSeed) 395 prepareSample( 396 "Uint64AddRotateWithReseed", 397 prng.ReadUint64AddRotateWithReseed, 398 true, 399 ) 400 a := make([]byte, 65536) 401 b := make([]byte, 65536) 402 mathrand.GlobalPRNG.ReadUint64AddRotate(a) 403 mathrand.GlobalPRNG.ReadUint64AddRotate(b) 404 assert.NotEqual(t, a, b) 405 } 406 func BenchmarkReadUint64AddRotateWithReseed1(b *testing.B) { 407 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateWithReseed, 1) 408 } 409 func BenchmarkReadUint64AddRotateWithReseed16(b *testing.B) { 410 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateWithReseed, 16) 411 } 412 func BenchmarkReadUint64AddRotateWithReseed1024(b *testing.B) { 413 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateWithReseed, 1024) 414 } 415 func BenchmarkReadUint64AddRotateWithReseed65536(b *testing.B) { 416 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateWithReseed, 65536) 417 } 418 func BenchmarkReadUint64AddRotateWithReseed65536Concurrent(b *testing.B) { 419 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddRotateWithReseed, 65536) 420 } 421 422 func TestXORReadUint64AddRotateWithReseed(t *testing.T) { 423 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddRotateWithReseed) 424 prng := mathrand.NewWithSeed(initialSeed) 425 prepareSample( 426 "XORUint64AddRotateWithReseed", 427 prng.ReadUint64AddRotateWithReseed, 428 true, 429 ) 430 a := make([]byte, 65536) 431 b := make([]byte, 65536) 432 mathrand.GlobalPRNG.XORReadUint64AddRotate(a) 433 mathrand.GlobalPRNG.XORReadUint64AddRotate(b) 434 assert.NotEqual(t, a, b) 435 } 436 func BenchmarkXORReadUint64AddRotateWithReseed1(b *testing.B) { 437 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateWithReseed, 1) 438 } 439 func BenchmarkXORReadUint64AddRotateWithReseed16(b *testing.B) { 440 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateWithReseed, 16) 441 } 442 func BenchmarkXORReadUint64AddRotateWithReseed1024(b *testing.B) { 443 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateWithReseed, 1024) 444 } 445 func BenchmarkXORReadUint64AddRotateWithReseed65536(b *testing.B) { 446 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateWithReseed, 65536) 447 } 448 func BenchmarkXORReadUint64AddRotateWithReseed65536Concurrent(b *testing.B) { 449 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddRotateWithReseed, 65536) 450 } 451 452 func TestReadUint64AddIfShiftXOR(t *testing.T) { 453 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR) 454 prng := mathrand.NewWithSeed(initialSeed) 455 prepareSample( 456 "Uint64AddIfShiftXOR", 457 prng.ReadUint64AddIfShiftXOR, 458 false, 459 ) 460 } 461 func BenchmarkReadUint64AddIfShiftXOR1(b *testing.B) { 462 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR, 1) 463 } 464 func BenchmarkReadUint64AddIfShiftXOR16(b *testing.B) { 465 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR, 16) 466 } 467 func BenchmarkReadUint64AddIfShiftXOR1024(b *testing.B) { 468 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR, 1024) 469 } 470 func BenchmarkReadUint64AddIfShiftXOR65536(b *testing.B) { 471 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR, 65536) 472 } 473 func BenchmarkReadUint64AddIfShiftXOR65536Concurrent(b *testing.B) { 474 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR, 65536) 475 } 476 477 func TestXORReadUint64AddIfShiftXOR(t *testing.T) { 478 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR) 479 prng := mathrand.NewWithSeed(initialSeed) 480 prepareSample( 481 "XORUint64AddIfShiftXOR", 482 prng.ReadUint64AddIfShiftXOR, 483 false, 484 ) 485 } 486 func BenchmarkXORReadUint64AddIfShiftXOR1(b *testing.B) { 487 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR, 1) 488 } 489 func BenchmarkXORReadUint64AddIfShiftXOR16(b *testing.B) { 490 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR, 16) 491 } 492 func BenchmarkXORReadUint64AddIfShiftXOR1024(b *testing.B) { 493 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR, 1024) 494 } 495 func BenchmarkXORReadUint64AddIfShiftXOR65536(b *testing.B) { 496 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR, 65536) 497 } 498 func BenchmarkXORReadUint64AddIfShiftXOR65536Concurrent(b *testing.B) { 499 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR, 65536) 500 } 501 502 func TestReadUint64AddIfShiftXORWithReseed(t *testing.T) { 503 //testRead(t, mathrand.GlobalPRNG.ReadUint64AddIfShiftXORWithReseed) 504 prng := mathrand.NewWithSeed(initialSeed) 505 prepareSample( 506 "Uint64AddIfShiftXORWithReseed", 507 prng.ReadUint64AddIfShiftXORWithReseed, 508 true, 509 ) 510 a := make([]byte, 65536) 511 b := make([]byte, 65536) 512 mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR(a) 513 mathrand.GlobalPRNG.ReadUint64AddIfShiftXOR(b) 514 assert.NotEqual(t, a, b) 515 } 516 func BenchmarkReadUint64AddIfShiftXORWithReseed1(b *testing.B) { 517 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXORWithReseed, 1) 518 } 519 func BenchmarkReadUint64AddIfShiftXORWithReseed16(b *testing.B) { 520 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXORWithReseed, 16) 521 } 522 func BenchmarkReadUint64AddIfShiftXORWithReseed1024(b *testing.B) { 523 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXORWithReseed, 1024) 524 } 525 func BenchmarkReadUint64AddIfShiftXORWithReseed65536(b *testing.B) { 526 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXORWithReseed, 65536) 527 } 528 func BenchmarkReadUint64AddIfShiftXORWithReseed65536Concurrent(b *testing.B) { 529 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64AddIfShiftXORWithReseed, 65536) 530 } 531 532 func TestXORReadUint64AddIfShiftXORWithReseed(t *testing.T) { 533 //testRead(t, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXORWithReseed) 534 prng := mathrand.NewWithSeed(initialSeed) 535 prepareSample( 536 "XORUint64AddIfShiftXORWithReseed", 537 prng.ReadUint64AddIfShiftXORWithReseed, 538 true, 539 ) 540 a := make([]byte, 65536) 541 b := make([]byte, 65536) 542 mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR(a) 543 mathrand.GlobalPRNG.XORReadUint64AddIfShiftXOR(b) 544 assert.NotEqual(t, a, b) 545 } 546 func BenchmarkXORReadUint64AddIfShiftXORWithReseed1(b *testing.B) { 547 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXORWithReseed, 1) 548 } 549 func BenchmarkXORReadUint64AddIfShiftXORWithReseed16(b *testing.B) { 550 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXORWithReseed, 16) 551 } 552 func BenchmarkXORReadUint64AddIfShiftXORWithReseed1024(b *testing.B) { 553 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXORWithReseed, 1024) 554 } 555 func BenchmarkXORReadUint64AddIfShiftXORWithReseed65536(b *testing.B) { 556 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXORWithReseed, 65536) 557 } 558 func BenchmarkXORReadUint64AddIfShiftXORWithReseed65536Concurrent(b *testing.B) { 559 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64AddIfShiftXORWithReseed, 65536) 560 } 561 562 func TestReadUint64Xorshift(t *testing.T) { 563 //testRead(t, mathrand.GlobalPRNG.ReadUint64Xorshift) 564 prng := mathrand.NewWithSeed(initialSeed) 565 prepareSample( 566 "Uint64Xorshift", 567 prng.ReadUint64Xorshift, 568 false, 569 ) 570 } 571 func BenchmarkReadUint64Xorshift1(b *testing.B) { 572 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xorshift, 1) 573 } 574 func BenchmarkReadUint64Xorshift16(b *testing.B) { 575 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xorshift, 16) 576 } 577 func BenchmarkReadUint64Xorshift1024(b *testing.B) { 578 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xorshift, 1024) 579 } 580 func BenchmarkReadUint64Xorshift65536(b *testing.B) { 581 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xorshift, 65536) 582 } 583 func BenchmarkReadUint64Xorshift65536Concurrent(b *testing.B) { 584 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64Xorshift, 65536) 585 } 586 587 func TestXORReadUint64Xorshift(t *testing.T) { 588 //testRead(t, mathrand.GlobalPRNG.XORReadUint64Xorshift) 589 prng := mathrand.NewWithSeed(initialSeed) 590 prepareSample( 591 "XORUint64Xorshift", 592 prng.ReadUint64Xorshift, 593 false, 594 ) 595 } 596 func BenchmarkXORReadUint64Xorshift1(b *testing.B) { 597 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xorshift, 1) 598 } 599 func BenchmarkXORReadUint64Xorshift16(b *testing.B) { 600 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xorshift, 16) 601 } 602 func BenchmarkXORReadUint64Xorshift1024(b *testing.B) { 603 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xorshift, 1024) 604 } 605 func BenchmarkXORReadUint64Xorshift65536(b *testing.B) { 606 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xorshift, 65536) 607 } 608 func BenchmarkXORReadUint64Xorshift65536Concurrent(b *testing.B) { 609 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64Xorshift, 65536) 610 } 611 612 func TestReadUint64XorshiftWithReseed(t *testing.T) { 613 //testRead(t, mathrand.GlobalPRNG.ReadUint64XorshiftWithReseed) 614 prng := mathrand.NewWithSeed(initialSeed) 615 prepareSample( 616 "Uint64XorshiftWithReseed", 617 prng.ReadUint64XorshiftWithReseed, 618 true, 619 ) 620 a := make([]byte, 65536) 621 b := make([]byte, 65536) 622 mathrand.GlobalPRNG.ReadUint64Xorshift(a) 623 mathrand.GlobalPRNG.ReadUint64Xorshift(b) 624 assert.NotEqual(t, a, b) 625 } 626 func BenchmarkReadUint64XorshiftWithReseed1(b *testing.B) { 627 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64XorshiftWithReseed, 1) 628 } 629 func BenchmarkReadUint64XorshiftWithReseed16(b *testing.B) { 630 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64XorshiftWithReseed, 16) 631 } 632 func BenchmarkReadUint64XorshiftWithReseed1024(b *testing.B) { 633 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64XorshiftWithReseed, 1024) 634 } 635 func BenchmarkReadUint64XorshiftWithReseed65536(b *testing.B) { 636 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64XorshiftWithReseed, 65536) 637 } 638 func BenchmarkReadUint64XorshiftWithReseed65536Concurrent(b *testing.B) { 639 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64XorshiftWithReseed, 65536) 640 } 641 642 func TestXORReadUint64XorshiftWithReseed(t *testing.T) { 643 //testRead(t, mathrand.GlobalPRNG.XORReadUint64XorshiftWithReseed) 644 prng := mathrand.NewWithSeed(initialSeed) 645 prepareSample( 646 "XORUint64XorshiftWithReseed", 647 prng.ReadUint64XorshiftWithReseed, 648 true, 649 ) 650 a := make([]byte, 65536) 651 b := make([]byte, 65536) 652 mathrand.GlobalPRNG.XORReadUint64Xorshift(a) 653 mathrand.GlobalPRNG.XORReadUint64Xorshift(b) 654 assert.NotEqual(t, a, b) 655 } 656 func BenchmarkXORReadUint64XorshiftWithReseed1(b *testing.B) { 657 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64XorshiftWithReseed, 1) 658 } 659 func BenchmarkXORReadUint64XorshiftWithReseed16(b *testing.B) { 660 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64XorshiftWithReseed, 16) 661 } 662 func BenchmarkXORReadUint64XorshiftWithReseed1024(b *testing.B) { 663 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64XorshiftWithReseed, 1024) 664 } 665 func BenchmarkXORReadUint64XorshiftWithReseed65536(b *testing.B) { 666 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64XorshiftWithReseed, 65536) 667 } 668 func BenchmarkXORReadUint64XorshiftWithReseed65536Concurrent(b *testing.B) { 669 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64XorshiftWithReseed, 65536) 670 } 671 672 func TestReadUint64Xoshiro256(t *testing.T) { 673 //testRead(t, mathrand.GlobalPRNG.ReadUint64Xoshiro256) 674 prng := mathrand.NewWithSeed(initialSeed) 675 prepareSample( 676 "Uint64Xoshiro256", 677 prng.ReadUint64Xoshiro256, 678 false, 679 ) 680 } 681 func BenchmarkReadUint64Xoshiro2561(b *testing.B) { 682 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256, 1) 683 } 684 func BenchmarkReadUint64Xoshiro25616(b *testing.B) { 685 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256, 16) 686 } 687 func BenchmarkReadUint64Xoshiro2561024(b *testing.B) { 688 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256, 1024) 689 } 690 func BenchmarkReadUint64Xoshiro25665536(b *testing.B) { 691 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256, 65536) 692 } 693 func BenchmarkReadUint64Xoshiro25665536Concurrent(b *testing.B) { 694 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256, 65536) 695 } 696 697 func TestXORReadUint64Xoshiro256(t *testing.T) { 698 //testRead(t, mathrand.GlobalPRNG.XORReadUint64Xoshiro256) 699 prng := mathrand.NewWithSeed(initialSeed) 700 prepareSample( 701 "XORUint64Xoshiro256", 702 prng.ReadUint64Xoshiro256, 703 false, 704 ) 705 } 706 func BenchmarkXORReadUint64Xoshiro2561(b *testing.B) { 707 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256, 1) 708 } 709 func BenchmarkXORReadUint64Xoshiro25616(b *testing.B) { 710 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256, 16) 711 } 712 func BenchmarkXORReadUint64Xoshiro2561024(b *testing.B) { 713 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256, 1024) 714 } 715 func BenchmarkXORReadUint64Xoshiro25665536(b *testing.B) { 716 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256, 65536) 717 } 718 func BenchmarkXORReadUint64Xoshiro25665536Concurrent(b *testing.B) { 719 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256, 65536) 720 } 721 722 func TestReadUint64Xoshiro256WithReseed(t *testing.T) { 723 //testRead(t, mathrand.GlobalPRNG.ReadUint64Xoshiro256WithReseed) 724 prng := mathrand.NewWithSeed(initialSeed) 725 prepareSample( 726 "Uint64Xoshiro256WithReseed", 727 prng.ReadUint64Xoshiro256WithReseed, 728 true, 729 ) 730 a := make([]byte, 65536) 731 b := make([]byte, 65536) 732 mathrand.GlobalPRNG.ReadUint64Xoshiro256(a) 733 mathrand.GlobalPRNG.ReadUint64Xoshiro256(b) 734 assert.NotEqual(t, a, b) 735 } 736 func BenchmarkReadUint64Xoshiro256WithReseed1(b *testing.B) { 737 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256WithReseed, 1) 738 } 739 func BenchmarkReadUint64Xoshiro256WithReseed16(b *testing.B) { 740 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256WithReseed, 16) 741 } 742 func BenchmarkReadUint64Xoshiro256WithReseed1024(b *testing.B) { 743 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256WithReseed, 1024) 744 } 745 func BenchmarkReadUint64Xoshiro256WithReseed65536(b *testing.B) { 746 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256WithReseed, 65536) 747 } 748 func BenchmarkReadUint64Xoshiro256WithReseed65536Concurrent(b *testing.B) { 749 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64Xoshiro256WithReseed, 65536) 750 } 751 752 func TestXORReadUint64Xoshiro256WithReseed(t *testing.T) { 753 //testRead(t, mathrand.GlobalPRNG.XORReadUint64Xoshiro256WithReseed) 754 prng := mathrand.NewWithSeed(initialSeed) 755 prepareSample( 756 "XORUint64Xoshiro256WithReseed", 757 prng.ReadUint64Xoshiro256WithReseed, 758 true, 759 ) 760 a := make([]byte, 65536) 761 b := make([]byte, 65536) 762 mathrand.GlobalPRNG.XORReadUint64Xoshiro256(a) 763 mathrand.GlobalPRNG.XORReadUint64Xoshiro256(b) 764 assert.NotEqual(t, a, b) 765 } 766 func BenchmarkXORReadUint64Xoshiro256WithReseed1(b *testing.B) { 767 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256WithReseed, 1) 768 } 769 func BenchmarkXORReadUint64Xoshiro256WithReseed16(b *testing.B) { 770 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256WithReseed, 16) 771 } 772 func BenchmarkXORReadUint64Xoshiro256WithReseed1024(b *testing.B) { 773 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256WithReseed, 1024) 774 } 775 func BenchmarkXORReadUint64Xoshiro256WithReseed65536(b *testing.B) { 776 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256WithReseed, 65536) 777 } 778 func BenchmarkXORReadUint64Xoshiro256WithReseed65536Concurrent(b *testing.B) { 779 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64Xoshiro256WithReseed, 65536) 780 } 781 782 func TestReadUint64MSWS(t *testing.T) { 783 //testRead(t, mathrand.GlobalPRNG.ReadUint64MSWS) 784 prng := mathrand.NewWithSeed(initialSeed) 785 prepareSample( 786 "Uint64MSWS", 787 prng.ReadUint64MSWS, 788 false, 789 ) 790 } 791 func BenchmarkReadUint64MSWS1(b *testing.B) { 792 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWS, 1) 793 } 794 func BenchmarkReadUint64MSWS16(b *testing.B) { 795 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWS, 16) 796 } 797 func BenchmarkReadUint64MSWS1024(b *testing.B) { 798 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWS, 1024) 799 } 800 func BenchmarkReadUint64MSWS65536(b *testing.B) { 801 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWS, 65536) 802 } 803 func BenchmarkReadUint64MSWS65536Concurrent(b *testing.B) { 804 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64MSWS, 65536) 805 } 806 807 func TestXORReadUint64MSWS(t *testing.T) { 808 //testRead(t, mathrand.GlobalPRNG.XORReadUint64MSWS) 809 prng := mathrand.NewWithSeed(initialSeed) 810 prepareSample( 811 "XORUint64MSWS", 812 prng.ReadUint64MSWS, 813 false, 814 ) 815 } 816 func BenchmarkXORReadUint64MSWS1(b *testing.B) { 817 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWS, 1) 818 } 819 func BenchmarkXORReadUint64MSWS16(b *testing.B) { 820 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWS, 16) 821 } 822 func BenchmarkXORReadUint64MSWS1024(b *testing.B) { 823 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWS, 1024) 824 } 825 func BenchmarkXORReadUint64MSWS65536(b *testing.B) { 826 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWS, 65536) 827 } 828 func BenchmarkXORReadUint64MSWS65536Concurrent(b *testing.B) { 829 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64MSWS, 65536) 830 } 831 832 func TestReadUint64MSWSWithReseed(t *testing.T) { 833 //testRead(t, mathrand.GlobalPRNG.ReadUint64MSWSWithReseed) 834 prng := mathrand.NewWithSeed(initialSeed) 835 prepareSample( 836 "Uint64MSWSWithReseed", 837 prng.ReadUint64MSWSWithReseed, 838 true, 839 ) 840 a := make([]byte, 65536) 841 b := make([]byte, 65536) 842 mathrand.GlobalPRNG.ReadUint64MSWS(a) 843 mathrand.GlobalPRNG.ReadUint64MSWS(b) 844 assert.NotEqual(t, a, b) 845 } 846 func BenchmarkReadUint64MSWSWithReseed1(b *testing.B) { 847 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWSWithReseed, 1) 848 } 849 func BenchmarkReadUint64MSWSWithReseed16(b *testing.B) { 850 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWSWithReseed, 16) 851 } 852 func BenchmarkReadUint64MSWSWithReseed1024(b *testing.B) { 853 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWSWithReseed, 1024) 854 } 855 func BenchmarkReadUint64MSWSWithReseed65536(b *testing.B) { 856 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint64MSWSWithReseed, 65536) 857 } 858 func BenchmarkReadUint64MSWSWithReseed65536Concurrent(b *testing.B) { 859 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint64MSWSWithReseed, 65536) 860 } 861 862 func TestXORReadUint64MSWSWithReseed(t *testing.T) { 863 //testRead(t, mathrand.GlobalPRNG.XORReadUint64MSWSWithReseed) 864 prng := mathrand.NewWithSeed(initialSeed) 865 prepareSample( 866 "XORUint64MSWSWithReseed", 867 prng.ReadUint64MSWSWithReseed, 868 true, 869 ) 870 a := make([]byte, 65536) 871 b := make([]byte, 65536) 872 mathrand.GlobalPRNG.XORReadUint64MSWS(a) 873 mathrand.GlobalPRNG.XORReadUint64MSWS(b) 874 assert.NotEqual(t, a, b) 875 } 876 func BenchmarkXORReadUint64MSWSWithReseed1(b *testing.B) { 877 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWSWithReseed, 1) 878 } 879 func BenchmarkXORReadUint64MSWSWithReseed16(b *testing.B) { 880 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWSWithReseed, 16) 881 } 882 func BenchmarkXORReadUint64MSWSWithReseed1024(b *testing.B) { 883 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWSWithReseed, 1024) 884 } 885 func BenchmarkXORReadUint64MSWSWithReseed65536(b *testing.B) { 886 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint64MSWSWithReseed, 65536) 887 } 888 func BenchmarkXORReadUint64MSWSWithReseed65536Concurrent(b *testing.B) { 889 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint64MSWSWithReseed, 65536) 890 } 891 892 func TestReadUint32AddRotateMultiply(t *testing.T) { 893 //testRead(t, mathrand.GlobalPRNG.ReadUint32AddRotateMultiply) 894 prng := mathrand.NewWithSeed(initialSeed) 895 prepareSample( 896 "Uint32AddRotateMultiply", 897 prng.ReadUint32AddRotateMultiply, 898 false, 899 ) 900 } 901 func BenchmarkReadUint32AddRotateMultiply1(b *testing.B) { 902 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiply, 1) 903 } 904 func BenchmarkReadUint32AddRotateMultiply16(b *testing.B) { 905 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiply, 16) 906 } 907 func BenchmarkReadUint32AddRotateMultiply1024(b *testing.B) { 908 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiply, 1024) 909 } 910 func BenchmarkReadUint32AddRotateMultiply65536(b *testing.B) { 911 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiply, 65536) 912 } 913 func BenchmarkReadUint32AddRotateMultiply65536Concurrent(b *testing.B) { 914 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiply, 65536) 915 } 916 917 func TestXORReadUint32AddRotateMultiply(t *testing.T) { 918 //testRead(t, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply) 919 prng := mathrand.NewWithSeed(initialSeed) 920 prepareSample( 921 "XORUint32AddRotateMultiply", 922 prng.ReadUint32AddRotateMultiply, 923 false, 924 ) 925 } 926 func BenchmarkXORReadUint32AddRotateMultiply1(b *testing.B) { 927 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply, 1) 928 } 929 func BenchmarkXORReadUint32AddRotateMultiply16(b *testing.B) { 930 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply, 16) 931 } 932 func BenchmarkXORReadUint32AddRotateMultiply1024(b *testing.B) { 933 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply, 1024) 934 } 935 func BenchmarkXORReadUint32AddRotateMultiply65536(b *testing.B) { 936 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply, 65536) 937 } 938 func BenchmarkXORReadUint32AddRotateMultiply65536Concurrent(b *testing.B) { 939 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply, 65536) 940 } 941 942 func TestReadUint32AddRotateMultiplyWithReseed(t *testing.T) { 943 //testRead(t, mathrand.GlobalPRNG.ReadUint32AddRotateMultiplyWithReseed) 944 prng := mathrand.NewWithSeed(initialSeed) 945 prepareSample( 946 "Uint32AddRotateMultiplyWithReseed", 947 prng.ReadUint32AddRotateMultiplyWithReseed, 948 true, 949 ) 950 a := make([]byte, 65536) 951 b := make([]byte, 65536) 952 mathrand.GlobalPRNG.ReadUint32AddRotateMultiply(a) 953 mathrand.GlobalPRNG.ReadUint32AddRotateMultiply(b) 954 assert.NotEqual(t, a, b) 955 } 956 func BenchmarkReadUint32AddRotateMultiplyWithReseed1(b *testing.B) { 957 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiplyWithReseed, 1) 958 } 959 func BenchmarkReadUint32AddRotateMultiplyWithReseed16(b *testing.B) { 960 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiplyWithReseed, 16) 961 } 962 func BenchmarkReadUint32AddRotateMultiplyWithReseed1024(b *testing.B) { 963 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiplyWithReseed, 1024) 964 } 965 func BenchmarkReadUint32AddRotateMultiplyWithReseed65536(b *testing.B) { 966 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiplyWithReseed, 65536) 967 } 968 func BenchmarkReadUint32AddRotateMultiplyWithReseed65536Concurrent(b *testing.B) { 969 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateMultiplyWithReseed, 65536) 970 } 971 972 func TestXORReadUint32AddRotateMultiplyWithReseed(t *testing.T) { 973 //testRead(t, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiplyWithReseed) 974 prng := mathrand.NewWithSeed(initialSeed) 975 prepareSample( 976 "XORUint32AddRotateMultiplyWithReseed", 977 prng.ReadUint32AddRotateMultiplyWithReseed, 978 true, 979 ) 980 a := make([]byte, 65536) 981 b := make([]byte, 65536) 982 mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply(a) 983 mathrand.GlobalPRNG.XORReadUint32AddRotateMultiply(b) 984 assert.NotEqual(t, a, b) 985 } 986 func BenchmarkXORReadUint32AddRotateMultiplyWithReseed1(b *testing.B) { 987 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiplyWithReseed, 1) 988 } 989 func BenchmarkXORReadUint32AddRotateMultiplyWithReseed16(b *testing.B) { 990 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiplyWithReseed, 16) 991 } 992 func BenchmarkXORReadUint32AddRotateMultiplyWithReseed1024(b *testing.B) { 993 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiplyWithReseed, 1024) 994 } 995 func BenchmarkXORReadUint32AddRotateMultiplyWithReseed65536(b *testing.B) { 996 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiplyWithReseed, 65536) 997 } 998 func BenchmarkXORReadUint32AddRotateMultiplyWithReseed65536Concurrent(b *testing.B) { 999 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateMultiplyWithReseed, 65536) 1000 } 1001 1002 func TestReadUint32MultiplyAdd(t *testing.T) { 1003 //testRead(t, mathrand.GlobalPRNG.ReadUint32MultiplyAdd) 1004 prng := mathrand.NewWithSeed(initialSeed) 1005 prepareSample( 1006 "Uint32MultiplyAdd", 1007 prng.ReadUint32MultiplyAdd, 1008 false, 1009 ) 1010 } 1011 func BenchmarkReadUint32MultiplyAdd1(b *testing.B) { 1012 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAdd, 1) 1013 } 1014 func BenchmarkReadUint32MultiplyAdd16(b *testing.B) { 1015 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAdd, 16) 1016 } 1017 func BenchmarkReadUint32MultiplyAdd1024(b *testing.B) { 1018 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAdd, 1024) 1019 } 1020 func BenchmarkReadUint32MultiplyAdd65536(b *testing.B) { 1021 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAdd, 65536) 1022 } 1023 func BenchmarkReadUint32MultiplyAdd65536Concurrent(b *testing.B) { 1024 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAdd, 65536) 1025 } 1026 1027 func TestXORReadUint32MultiplyAdd(t *testing.T) { 1028 //testRead(t, mathrand.GlobalPRNG.XORReadUint32MultiplyAdd) 1029 prng := mathrand.NewWithSeed(initialSeed) 1030 prepareSample( 1031 "XORUint32MultiplyAdd", 1032 prng.ReadUint32MultiplyAdd, 1033 false, 1034 ) 1035 } 1036 func BenchmarkXORReadUint32MultiplyAdd1(b *testing.B) { 1037 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAdd, 1) 1038 } 1039 func BenchmarkXORReadUint32MultiplyAdd16(b *testing.B) { 1040 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAdd, 16) 1041 } 1042 func BenchmarkXORReadUint32MultiplyAdd1024(b *testing.B) { 1043 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAdd, 1024) 1044 } 1045 func BenchmarkXORReadUint32MultiplyAdd65536(b *testing.B) { 1046 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAdd, 65536) 1047 } 1048 func BenchmarkXORReadUint32MultiplyAdd65536Concurrent(b *testing.B) { 1049 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAdd, 65536) 1050 } 1051 1052 func TestReadUint32MultiplyAddWithReseed(t *testing.T) { 1053 //testRead(t, mathrand.GlobalPRNG.ReadUint32MultiplyAddWithReseed) 1054 prng := mathrand.NewWithSeed(initialSeed) 1055 prepareSample( 1056 "Uint32MultiplyAddWithReseed", 1057 prng.ReadUint32MultiplyAddWithReseed, 1058 true, 1059 ) 1060 a := make([]byte, 65536) 1061 b := make([]byte, 65536) 1062 mathrand.GlobalPRNG.ReadUint32MultiplyAdd(a) 1063 mathrand.GlobalPRNG.ReadUint32MultiplyAdd(b) 1064 assert.NotEqual(t, a, b) 1065 } 1066 func BenchmarkReadUint32MultiplyAddWithReseed1(b *testing.B) { 1067 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAddWithReseed, 1) 1068 } 1069 func BenchmarkReadUint32MultiplyAddWithReseed16(b *testing.B) { 1070 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAddWithReseed, 16) 1071 } 1072 func BenchmarkReadUint32MultiplyAddWithReseed1024(b *testing.B) { 1073 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAddWithReseed, 1024) 1074 } 1075 func BenchmarkReadUint32MultiplyAddWithReseed65536(b *testing.B) { 1076 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAddWithReseed, 65536) 1077 } 1078 func BenchmarkReadUint32MultiplyAddWithReseed65536Concurrent(b *testing.B) { 1079 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32MultiplyAddWithReseed, 65536) 1080 } 1081 1082 func TestXORReadUint32MultiplyAddWithReseed(t *testing.T) { 1083 //testRead(t, mathrand.GlobalPRNG.XORReadUint32MultiplyAddWithReseed) 1084 prng := mathrand.NewWithSeed(initialSeed) 1085 prepareSample( 1086 "XORUint32MultiplyAddWithReseed", 1087 prng.ReadUint32MultiplyAddWithReseed, 1088 true, 1089 ) 1090 a := make([]byte, 65536) 1091 b := make([]byte, 65536) 1092 mathrand.GlobalPRNG.XORReadUint32MultiplyAdd(a) 1093 mathrand.GlobalPRNG.XORReadUint32MultiplyAdd(b) 1094 assert.NotEqual(t, a, b) 1095 } 1096 func BenchmarkXORReadUint32MultiplyAddWithReseed1(b *testing.B) { 1097 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAddWithReseed, 1) 1098 } 1099 func BenchmarkXORReadUint32MultiplyAddWithReseed16(b *testing.B) { 1100 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAddWithReseed, 16) 1101 } 1102 func BenchmarkXORReadUint32MultiplyAddWithReseed1024(b *testing.B) { 1103 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAddWithReseed, 1024) 1104 } 1105 func BenchmarkXORReadUint32MultiplyAddWithReseed65536(b *testing.B) { 1106 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAddWithReseed, 65536) 1107 } 1108 func BenchmarkXORReadUint32MultiplyAddWithReseed65536Concurrent(b *testing.B) { 1109 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32MultiplyAddWithReseed, 65536) 1110 } 1111 1112 func TestReadUint32AddRotate(t *testing.T) { 1113 //testRead(t, mathrand.GlobalPRNG.ReadUint32AddRotate) 1114 prng := mathrand.NewWithSeed(initialSeed) 1115 prepareSample( 1116 "Uint32AddRotate", 1117 prng.ReadUint32AddRotate, 1118 false, 1119 ) 1120 } 1121 func BenchmarkReadUint32AddRotate1(b *testing.B) { 1122 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotate, 1) 1123 } 1124 func BenchmarkReadUint32AddRotate16(b *testing.B) { 1125 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotate, 16) 1126 } 1127 func BenchmarkReadUint32AddRotate1024(b *testing.B) { 1128 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotate, 1024) 1129 } 1130 func BenchmarkReadUint32AddRotate65536(b *testing.B) { 1131 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotate, 65536) 1132 } 1133 func BenchmarkReadUint32AddRotate65536Concurrent(b *testing.B) { 1134 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32AddRotate, 65536) 1135 } 1136 1137 func TestXORReadUint32AddRotate(t *testing.T) { 1138 //testRead(t, mathrand.GlobalPRNG.XORReadUint32AddRotate) 1139 prng := mathrand.NewWithSeed(initialSeed) 1140 prepareSample( 1141 "XORUint32AddRotate", 1142 prng.ReadUint32AddRotate, 1143 false, 1144 ) 1145 } 1146 func BenchmarkXORReadUint32AddRotate1(b *testing.B) { 1147 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotate, 1) 1148 } 1149 func BenchmarkXORReadUint32AddRotate16(b *testing.B) { 1150 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotate, 16) 1151 } 1152 func BenchmarkXORReadUint32AddRotate1024(b *testing.B) { 1153 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotate, 1024) 1154 } 1155 func BenchmarkXORReadUint32AddRotate65536(b *testing.B) { 1156 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotate, 65536) 1157 } 1158 func BenchmarkXORReadUint32AddRotate65536Concurrent(b *testing.B) { 1159 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotate, 65536) 1160 } 1161 1162 func TestReadUint32AddRotateWithReseed(t *testing.T) { 1163 //testRead(t, mathrand.GlobalPRNG.ReadUint32AddRotateWithReseed) 1164 prng := mathrand.NewWithSeed(initialSeed) 1165 prepareSample( 1166 "Uint32AddRotateWithReseed", 1167 prng.ReadUint32AddRotateWithReseed, 1168 true, 1169 ) 1170 a := make([]byte, 65536) 1171 b := make([]byte, 65536) 1172 mathrand.GlobalPRNG.ReadUint32AddRotate(a) 1173 mathrand.GlobalPRNG.ReadUint32AddRotate(b) 1174 assert.NotEqual(t, a, b) 1175 } 1176 func BenchmarkReadUint32AddRotateWithReseed1(b *testing.B) { 1177 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateWithReseed, 1) 1178 } 1179 func BenchmarkReadUint32AddRotateWithReseed16(b *testing.B) { 1180 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateWithReseed, 16) 1181 } 1182 func BenchmarkReadUint32AddRotateWithReseed1024(b *testing.B) { 1183 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateWithReseed, 1024) 1184 } 1185 func BenchmarkReadUint32AddRotateWithReseed65536(b *testing.B) { 1186 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateWithReseed, 65536) 1187 } 1188 func BenchmarkReadUint32AddRotateWithReseed65536Concurrent(b *testing.B) { 1189 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32AddRotateWithReseed, 65536) 1190 } 1191 1192 func TestXORReadUint32AddRotateWithReseed(t *testing.T) { 1193 //testRead(t, mathrand.GlobalPRNG.XORReadUint32AddRotateWithReseed) 1194 prng := mathrand.NewWithSeed(initialSeed) 1195 prepareSample( 1196 "XORUint32AddRotateWithReseed", 1197 prng.ReadUint32AddRotateWithReseed, 1198 true, 1199 ) 1200 a := make([]byte, 65536) 1201 b := make([]byte, 65536) 1202 mathrand.GlobalPRNG.XORReadUint32AddRotate(a) 1203 mathrand.GlobalPRNG.XORReadUint32AddRotate(b) 1204 assert.NotEqual(t, a, b) 1205 } 1206 func BenchmarkXORReadUint32AddRotateWithReseed1(b *testing.B) { 1207 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateWithReseed, 1) 1208 } 1209 func BenchmarkXORReadUint32AddRotateWithReseed16(b *testing.B) { 1210 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateWithReseed, 16) 1211 } 1212 func BenchmarkXORReadUint32AddRotateWithReseed1024(b *testing.B) { 1213 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateWithReseed, 1024) 1214 } 1215 func BenchmarkXORReadUint32AddRotateWithReseed65536(b *testing.B) { 1216 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateWithReseed, 65536) 1217 } 1218 func BenchmarkXORReadUint32AddRotateWithReseed65536Concurrent(b *testing.B) { 1219 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32AddRotateWithReseed, 65536) 1220 } 1221 1222 func TestReadUint32AddIfShiftXOR(t *testing.T) { 1223 //testRead(t, mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR) 1224 prng := mathrand.NewWithSeed(initialSeed) 1225 prepareSample( 1226 "Uint32AddIfShiftXOR", 1227 prng.ReadUint32AddIfShiftXOR, 1228 false, 1229 ) 1230 } 1231 func BenchmarkReadUint32AddIfShiftXOR1(b *testing.B) { 1232 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR, 1) 1233 } 1234 func BenchmarkReadUint32AddIfShiftXOR16(b *testing.B) { 1235 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR, 16) 1236 } 1237 func BenchmarkReadUint32AddIfShiftXOR1024(b *testing.B) { 1238 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR, 1024) 1239 } 1240 func BenchmarkReadUint32AddIfShiftXOR65536(b *testing.B) { 1241 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR, 65536) 1242 } 1243 func BenchmarkReadUint32AddIfShiftXOR65536Concurrent(b *testing.B) { 1244 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR, 65536) 1245 } 1246 1247 func TestXORReadUint32AddIfShiftXOR(t *testing.T) { 1248 //testRead(t, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR) 1249 prng := mathrand.NewWithSeed(initialSeed) 1250 prepareSample( 1251 "XORUint32AddIfShiftXOR", 1252 prng.ReadUint32AddIfShiftXOR, 1253 false, 1254 ) 1255 } 1256 func BenchmarkXORReadUint32AddIfShiftXOR1(b *testing.B) { 1257 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR, 1) 1258 } 1259 func BenchmarkXORReadUint32AddIfShiftXOR16(b *testing.B) { 1260 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR, 16) 1261 } 1262 func BenchmarkXORReadUint32AddIfShiftXOR1024(b *testing.B) { 1263 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR, 1024) 1264 } 1265 func BenchmarkXORReadUint32AddIfShiftXOR65536(b *testing.B) { 1266 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR, 65536) 1267 } 1268 func BenchmarkXORReadUint32AddIfShiftXOR65536Concurrent(b *testing.B) { 1269 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR, 65536) 1270 } 1271 1272 func TestReadUint32AddIfShiftXORWithReseed(t *testing.T) { 1273 //testRead(t, mathrand.GlobalPRNG.ReadUint32AddIfShiftXORWithReseed) 1274 prng := mathrand.NewWithSeed(initialSeed) 1275 prepareSample( 1276 "Uint32AddIfShiftXORWithReseed", 1277 prng.ReadUint32AddIfShiftXORWithReseed, 1278 true, 1279 ) 1280 a := make([]byte, 65536) 1281 b := make([]byte, 65536) 1282 mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR(a) 1283 mathrand.GlobalPRNG.ReadUint32AddIfShiftXOR(b) 1284 assert.NotEqual(t, a, b) 1285 } 1286 func BenchmarkReadUint32AddIfShiftXORWithReseed1(b *testing.B) { 1287 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXORWithReseed, 1) 1288 } 1289 func BenchmarkReadUint32AddIfShiftXORWithReseed16(b *testing.B) { 1290 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXORWithReseed, 16) 1291 } 1292 func BenchmarkReadUint32AddIfShiftXORWithReseed1024(b *testing.B) { 1293 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXORWithReseed, 1024) 1294 } 1295 func BenchmarkReadUint32AddIfShiftXORWithReseed65536(b *testing.B) { 1296 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXORWithReseed, 65536) 1297 } 1298 func BenchmarkReadUint32AddIfShiftXORWithReseed65536Concurrent(b *testing.B) { 1299 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32AddIfShiftXORWithReseed, 65536) 1300 } 1301 1302 func TestXORReadUint32AddIfShiftXORWithReseed(t *testing.T) { 1303 //testRead(t, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXORWithReseed) 1304 prng := mathrand.NewWithSeed(initialSeed) 1305 prepareSample( 1306 "XORUint32AddIfShiftXORWithReseed", 1307 prng.ReadUint32AddIfShiftXORWithReseed, 1308 true, 1309 ) 1310 a := make([]byte, 65536) 1311 b := make([]byte, 65536) 1312 mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR(a) 1313 mathrand.GlobalPRNG.XORReadUint32AddIfShiftXOR(b) 1314 assert.NotEqual(t, a, b) 1315 } 1316 func BenchmarkXORReadUint32AddIfShiftXORWithReseed1(b *testing.B) { 1317 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXORWithReseed, 1) 1318 } 1319 func BenchmarkXORReadUint32AddIfShiftXORWithReseed16(b *testing.B) { 1320 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXORWithReseed, 16) 1321 } 1322 func BenchmarkXORReadUint32AddIfShiftXORWithReseed1024(b *testing.B) { 1323 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXORWithReseed, 1024) 1324 } 1325 func BenchmarkXORReadUint32AddIfShiftXORWithReseed65536(b *testing.B) { 1326 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXORWithReseed, 65536) 1327 } 1328 func BenchmarkXORReadUint32AddIfShiftXORWithReseed65536Concurrent(b *testing.B) { 1329 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32AddIfShiftXORWithReseed, 65536) 1330 } 1331 1332 func TestReadUint32Xorshift(t *testing.T) { 1333 //testRead(t, mathrand.GlobalPRNG.ReadUint32Xorshift) 1334 prng := mathrand.NewWithSeed(initialSeed) 1335 prepareSample( 1336 "Uint32Xorshift", 1337 prng.ReadUint32Xorshift, 1338 false, 1339 ) 1340 } 1341 func BenchmarkReadUint32Xorshift1(b *testing.B) { 1342 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32Xorshift, 1) 1343 } 1344 func BenchmarkReadUint32Xorshift16(b *testing.B) { 1345 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32Xorshift, 16) 1346 } 1347 func BenchmarkReadUint32Xorshift1024(b *testing.B) { 1348 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32Xorshift, 1024) 1349 } 1350 func BenchmarkReadUint32Xorshift65536(b *testing.B) { 1351 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32Xorshift, 65536) 1352 } 1353 func BenchmarkReadUint32Xorshift65536Concurrent(b *testing.B) { 1354 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32Xorshift, 65536) 1355 } 1356 1357 func TestXORReadUint32Xorshift(t *testing.T) { 1358 //testRead(t, mathrand.GlobalPRNG.XORReadUint32Xorshift) 1359 prng := mathrand.NewWithSeed(initialSeed) 1360 prepareSample( 1361 "XORUint32Xorshift", 1362 prng.ReadUint32Xorshift, 1363 false, 1364 ) 1365 } 1366 func BenchmarkXORReadUint32Xorshift1(b *testing.B) { 1367 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32Xorshift, 1) 1368 } 1369 func BenchmarkXORReadUint32Xorshift16(b *testing.B) { 1370 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32Xorshift, 16) 1371 } 1372 func BenchmarkXORReadUint32Xorshift1024(b *testing.B) { 1373 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32Xorshift, 1024) 1374 } 1375 func BenchmarkXORReadUint32Xorshift65536(b *testing.B) { 1376 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32Xorshift, 65536) 1377 } 1378 func BenchmarkXORReadUint32Xorshift65536Concurrent(b *testing.B) { 1379 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32Xorshift, 65536) 1380 } 1381 1382 func TestReadUint32XorshiftWithReseed(t *testing.T) { 1383 //testRead(t, mathrand.GlobalPRNG.ReadUint32XorshiftWithReseed) 1384 prng := mathrand.NewWithSeed(initialSeed) 1385 prepareSample( 1386 "Uint32XorshiftWithReseed", 1387 prng.ReadUint32XorshiftWithReseed, 1388 true, 1389 ) 1390 a := make([]byte, 65536) 1391 b := make([]byte, 65536) 1392 mathrand.GlobalPRNG.ReadUint32Xorshift(a) 1393 mathrand.GlobalPRNG.ReadUint32Xorshift(b) 1394 assert.NotEqual(t, a, b) 1395 } 1396 func BenchmarkReadUint32XorshiftWithReseed1(b *testing.B) { 1397 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32XorshiftWithReseed, 1) 1398 } 1399 func BenchmarkReadUint32XorshiftWithReseed16(b *testing.B) { 1400 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32XorshiftWithReseed, 16) 1401 } 1402 func BenchmarkReadUint32XorshiftWithReseed1024(b *testing.B) { 1403 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32XorshiftWithReseed, 1024) 1404 } 1405 func BenchmarkReadUint32XorshiftWithReseed65536(b *testing.B) { 1406 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32XorshiftWithReseed, 65536) 1407 } 1408 func BenchmarkReadUint32XorshiftWithReseed65536Concurrent(b *testing.B) { 1409 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32XorshiftWithReseed, 65536) 1410 } 1411 1412 func TestXORReadUint32XorshiftWithReseed(t *testing.T) { 1413 //testRead(t, mathrand.GlobalPRNG.XORReadUint32XorshiftWithReseed) 1414 prng := mathrand.NewWithSeed(initialSeed) 1415 prepareSample( 1416 "XORUint32XorshiftWithReseed", 1417 prng.ReadUint32XorshiftWithReseed, 1418 true, 1419 ) 1420 a := make([]byte, 65536) 1421 b := make([]byte, 65536) 1422 mathrand.GlobalPRNG.XORReadUint32Xorshift(a) 1423 mathrand.GlobalPRNG.XORReadUint32Xorshift(b) 1424 assert.NotEqual(t, a, b) 1425 } 1426 func BenchmarkXORReadUint32XorshiftWithReseed1(b *testing.B) { 1427 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32XorshiftWithReseed, 1) 1428 } 1429 func BenchmarkXORReadUint32XorshiftWithReseed16(b *testing.B) { 1430 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32XorshiftWithReseed, 16) 1431 } 1432 func BenchmarkXORReadUint32XorshiftWithReseed1024(b *testing.B) { 1433 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32XorshiftWithReseed, 1024) 1434 } 1435 func BenchmarkXORReadUint32XorshiftWithReseed65536(b *testing.B) { 1436 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32XorshiftWithReseed, 65536) 1437 } 1438 func BenchmarkXORReadUint32XorshiftWithReseed65536Concurrent(b *testing.B) { 1439 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32XorshiftWithReseed, 65536) 1440 } 1441 1442 func TestReadUint32PCG(t *testing.T) { 1443 //testRead(t, mathrand.GlobalPRNG.ReadUint32PCG) 1444 prng := mathrand.NewWithSeed(initialSeed) 1445 prepareSample( 1446 "Uint32PCG", 1447 prng.ReadUint32PCG, 1448 false, 1449 ) 1450 } 1451 func BenchmarkReadUint32PCG1(b *testing.B) { 1452 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCG, 1) 1453 } 1454 func BenchmarkReadUint32PCG16(b *testing.B) { 1455 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCG, 16) 1456 } 1457 func BenchmarkReadUint32PCG1024(b *testing.B) { 1458 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCG, 1024) 1459 } 1460 func BenchmarkReadUint32PCG65536(b *testing.B) { 1461 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCG, 65536) 1462 } 1463 func BenchmarkReadUint32PCG65536Concurrent(b *testing.B) { 1464 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32PCG, 65536) 1465 } 1466 1467 func TestXORReadUint32PCG(t *testing.T) { 1468 //testRead(t, mathrand.GlobalPRNG.XORReadUint32PCG) 1469 prng := mathrand.NewWithSeed(initialSeed) 1470 prepareSample( 1471 "XORUint32PCG", 1472 prng.ReadUint32PCG, 1473 false, 1474 ) 1475 } 1476 func BenchmarkXORReadUint32PCG1(b *testing.B) { 1477 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCG, 1) 1478 } 1479 func BenchmarkXORReadUint32PCG16(b *testing.B) { 1480 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCG, 16) 1481 } 1482 func BenchmarkXORReadUint32PCG1024(b *testing.B) { 1483 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCG, 1024) 1484 } 1485 func BenchmarkXORReadUint32PCG65536(b *testing.B) { 1486 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCG, 65536) 1487 } 1488 func BenchmarkXORReadUint32PCG65536Concurrent(b *testing.B) { 1489 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32PCG, 65536) 1490 } 1491 1492 func TestReadUint32PCGWithReseed(t *testing.T) { 1493 //testRead(t, mathrand.GlobalPRNG.ReadUint32PCGWithReseed) 1494 prng := mathrand.NewWithSeed(initialSeed) 1495 prepareSample( 1496 "Uint32PCGWithReseed", 1497 prng.ReadUint32PCGWithReseed, 1498 true, 1499 ) 1500 a := make([]byte, 65536) 1501 b := make([]byte, 65536) 1502 mathrand.GlobalPRNG.ReadUint32PCG(a) 1503 mathrand.GlobalPRNG.ReadUint32PCG(b) 1504 assert.NotEqual(t, a, b) 1505 } 1506 func BenchmarkReadUint32PCGWithReseed1(b *testing.B) { 1507 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCGWithReseed, 1) 1508 } 1509 func BenchmarkReadUint32PCGWithReseed16(b *testing.B) { 1510 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCGWithReseed, 16) 1511 } 1512 func BenchmarkReadUint32PCGWithReseed1024(b *testing.B) { 1513 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCGWithReseed, 1024) 1514 } 1515 func BenchmarkReadUint32PCGWithReseed65536(b *testing.B) { 1516 benchmarkRead(b, mathrand.GlobalPRNG.ReadUint32PCGWithReseed, 65536) 1517 } 1518 func BenchmarkReadUint32PCGWithReseed65536Concurrent(b *testing.B) { 1519 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.ReadUint32PCGWithReseed, 65536) 1520 } 1521 1522 func TestXORReadUint32PCGWithReseed(t *testing.T) { 1523 //testRead(t, mathrand.GlobalPRNG.XORReadUint32PCGWithReseed) 1524 prng := mathrand.NewWithSeed(initialSeed) 1525 prepareSample( 1526 "XORUint32PCGWithReseed", 1527 prng.ReadUint32PCGWithReseed, 1528 true, 1529 ) 1530 a := make([]byte, 65536) 1531 b := make([]byte, 65536) 1532 mathrand.GlobalPRNG.XORReadUint32PCG(a) 1533 mathrand.GlobalPRNG.XORReadUint32PCG(b) 1534 assert.NotEqual(t, a, b) 1535 } 1536 func BenchmarkXORReadUint32PCGWithReseed1(b *testing.B) { 1537 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCGWithReseed, 1) 1538 } 1539 func BenchmarkXORReadUint32PCGWithReseed16(b *testing.B) { 1540 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCGWithReseed, 16) 1541 } 1542 func BenchmarkXORReadUint32PCGWithReseed1024(b *testing.B) { 1543 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCGWithReseed, 1024) 1544 } 1545 func BenchmarkXORReadUint32PCGWithReseed65536(b *testing.B) { 1546 benchmarkRead(b, mathrand.GlobalPRNG.XORReadUint32PCGWithReseed, 65536) 1547 } 1548 func BenchmarkXORReadUint32PCGWithReseed65536Concurrent(b *testing.B) { 1549 benchmarkConcurrentRead(b, mathrand.GlobalPRNG.XORReadUint32PCGWithReseed, 65536) 1550 }