chore: more readable benchmark case for shuffle
This commit is contained in:
parent
1b9c390ce6
commit
6d090095b4
1 changed files with 24 additions and 3 deletions
|
@ -85,7 +85,14 @@ func TestShuffleFuncThree(t *testing.T) {
|
||||||
|
|
||||||
func BenchmarkShuffleFuncThree(b *testing.B) {
|
func BenchmarkShuffleFuncThree(b *testing.B) {
|
||||||
var out []any
|
var out []any
|
||||||
var benchmarkCase = []any{-183, -34, -118, -51, 161, -39, 60, -170, -15, -148, 70, 176, -101, -81, 156, -43, -130, 193, 64, 127, 49, 133, 199, -92, 178, -24, -139, 48, -171, 65, 187, -20, 124, 76, 68, -100, 43, 22, -21, 36, -46, 129, 40, 100, 171, 105, -165, 71, -192, -72, -93, -132, 34, 67, 55, -129, -41, 158, 46, 138}
|
var benchmarkCase = []any{
|
||||||
|
-183, -34, -118, -51, 161, -39, 60, -170, -15, -148,
|
||||||
|
70, 176, -101, -81, 156, -43, -130, 193, 64, 127,
|
||||||
|
49, 133, 199, -92, 178, -24, -139, 48, -171,
|
||||||
|
65, 187, -20, 124, 76, 68, -100, 43, 22, -21,
|
||||||
|
36, -46, 129, 40, 100, 171, 105, -165, 71, -192,
|
||||||
|
-72, -93, -132, 34, 67, 55, -129, -41, 158, 46, 138,
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
out = shuffleFuncThree(benchmarkCase, 47, 16)
|
out = shuffleFuncThree(benchmarkCase, 47, 16)
|
||||||
|
@ -96,7 +103,14 @@ func BenchmarkShuffleFuncThree(b *testing.B) {
|
||||||
|
|
||||||
func BenchmarkShuffleFuncTwo(b *testing.B) {
|
func BenchmarkShuffleFuncTwo(b *testing.B) {
|
||||||
var out []any
|
var out []any
|
||||||
var benchmarkCase = []any{-183, -34, -118, -51, 161, -39, 60, -170, -15, -148, 70, 176, -101, -81, 156, -43, -130, 193, 64, 127, 49, 133, 199, -92, 178, -24, -139, 48, -171, 65, 187, -20, 124, 76, 68, -100, 43, 22, -21, 36, -46, 129, 40, 100, 171, 105, -165, 71, -192, -72, -93, -132, 34, 67, 55, -129, -41, 158, 46, 138}
|
var benchmarkCase = []any{
|
||||||
|
-183, -34, -118, -51, 161, -39, 60, -170, -15, -148,
|
||||||
|
70, 176, -101, -81, 156, -43, -130, 193, 64, 127,
|
||||||
|
49, 133, 199, -92, 178, -24, -139, 48, -171,
|
||||||
|
65, 187, -20, 124, 76, 68, -100, 43, 22, -21,
|
||||||
|
36, -46, 129, 40, 100, 171, 105, -165, 71, -192,
|
||||||
|
-72, -93, -132, 34, 67, 55, -129, -41, 158, 46, 138,
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
out = shuffleFuncTwo(benchmarkCase, 47, 16)
|
out = shuffleFuncTwo(benchmarkCase, 47, 16)
|
||||||
|
@ -107,7 +121,14 @@ func BenchmarkShuffleFuncTwo(b *testing.B) {
|
||||||
|
|
||||||
func BenchmarkShuffleFuncOne(b *testing.B) {
|
func BenchmarkShuffleFuncOne(b *testing.B) {
|
||||||
var out []any
|
var out []any
|
||||||
var benchmarkCase = []any{-183, -34, -118, -51, 161, -39, 60, -170, -15, -148, 70, 176, -101, -81, 156, -43, -130, 193, 64, 127, 49, 133, 199, -92, 178, -24, -139, 48, -171, 65, 187, -20, 124, 76, 68, -100, 43, 22, -21, 36, -46, 129, 40, 100, 171, 105, -165, 71, -192, -72, -93, -132, 34, 67, 55, -129, -41, 158, 46, 138}
|
var benchmarkCase = []any{
|
||||||
|
-183, -34, -118, -51, 161, -39, 60, -170, -15, -148,
|
||||||
|
70, 176, -101, -81, 156, -43, -130, 193, 64, 127,
|
||||||
|
49, 133, 199, -92, 178, -24, -139, 48, -171,
|
||||||
|
65, 187, -20, 124, 76, 68, -100, 43, 22, -21,
|
||||||
|
36, -46, 129, 40, 100, 171, 105, -165, 71, -192,
|
||||||
|
-72, -93, -132, 34, 67, 55, -129, -41, 158, 46, 138,
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
out = shuffleFuncOne(benchmarkCase, 47, 16)
|
out = shuffleFuncOne(benchmarkCase, 47, 16)
|
||||||
|
|
Loading…
Reference in a new issue