1 // Copyright 2017 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 func BenchmarkFastrand(b *testing.B) {
14 b.RunParallel(func(pb *testing.PB) {
21 func BenchmarkFastrand64(b *testing.B) {
22 b.RunParallel(func(pb *testing.PB) {
29 func BenchmarkFastrandHashiter(b *testing.B) {
30 var m = make(map[int]int, 10)
31 for i := 0; i < 10; i++ {
34 b.RunParallel(func(pb *testing.PB) {
45 func BenchmarkFastrandn(b *testing.B) {
46 for n := uint32(2); n <= 5; n++ {
47 b.Run(strconv.Itoa(int(n)), func(b *testing.B) {
48 for i := 0; i < b.N; i++ {