-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
benchmark_test.go
38 lines (33 loc) · 971 Bytes
/
benchmark_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package copy
import (
"fmt"
"testing"
)
func BenchmarkOptions_NumOfWorkers_0(b *testing.B) {
var num int64 = 0 // 0 or 1 = single-threaded
opt := Options{NumOfWorkers: num}
for i := 0; i < b.N; i++ {
Copy("test/data/case19", fmt.Sprintf("test/data.copy/case19-%d-%d", num, i), opt)
}
}
func BenchmarkOptions_NumOfWorkers_2(b *testing.B) {
var num int64 = 2
opt := Options{NumOfWorkers: num}
for i := 0; i < b.N; i++ {
Copy("test/data/case19", fmt.Sprintf("test/data.copy/case19-%d-%d", num, i), opt)
}
}
func BenchmarkOptions_NumOfWorkers_4(b *testing.B) {
var num int64 = 4
opt := Options{NumOfWorkers: num}
for i := 0; i < b.N; i++ {
Copy("test/data/case19", fmt.Sprintf("test/data.copy/case19-%d-%d", num, i), opt)
}
}
func BenchmarkOptions_NumOfWorkers_8(b *testing.B) {
var num int64 = 8
opt := Options{NumOfWorkers: num}
for i := 0; i < b.N; i++ {
Copy("test/data/case19", fmt.Sprintf("test/data.copy/case19-%d-%d", num, i), opt)
}
}