-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
DIR=$(cd $(dirname $BASH_SOURCE); pwd) | ||
|
||
gotest() { | ||
cpu=${3:-$(nproc)} | ||
go test -bench "$1" -benchmem -benchtime 5s -cpu $cpu . \ | ||
| tee "$2" | ||
} | ||
|
||
( | ||
cd $DIR | ||
gotest BenchmarkFilter_Volumes filter-volumes.txt | ||
gotest BenchmarkFilter_Compare filter-compare-8.txt | ||
gotest BenchmarkFilter_Compare filter-compare-1.txt 1 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
goos: linux | ||
goarch: amd64 | ||
pkg: github.com/meian/gcf/bench | ||
cpu: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz | ||
BenchmarkFilter_Compare/filter 2338778 2547 ns/op 144 B/op 4 allocs/op | ||
BenchmarkFilter_Compare/if-func 9481165 620.8 ns/op 0 B/op 0 allocs/op | ||
BenchmarkFilter_Compare/if-inline 155062731 38.53 ns/op 0 B/op 0 allocs/op | ||
BenchmarkFilter_Compare/chan 76498 78090 ns/op 384 B/op 6 allocs/op | ||
PASS | ||
ok github.com/meian/gcf/bench 31.790s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
goos: linux | ||
goarch: amd64 | ||
pkg: github.com/meian/gcf/bench | ||
cpu: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz | ||
BenchmarkFilter_Compare/filter-8 2325522 2551 ns/op 144 B/op 4 allocs/op | ||
BenchmarkFilter_Compare/if-func-8 9611860 643.7 ns/op 0 B/op 0 allocs/op | ||
BenchmarkFilter_Compare/if-inline-8 155326840 38.86 ns/op 0 B/op 0 allocs/op | ||
BenchmarkFilter_Compare/chan-8 41066 151074 ns/op 384 B/op 6 allocs/op | ||
PASS | ||
ok github.com/meian/gcf/bench 33.025s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
goos: linux | ||
goarch: amd64 | ||
pkg: github.com/meian/gcf/bench | ||
cpu: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz | ||
BenchmarkFilter_Volumes/slice=10/filter=1-8 28708957 200.3 ns/op 80 B/op 2 allocs/op | ||
BenchmarkFilter_Volumes/slice=10/filter=5-8 8568411 694.7 ns/op 208 B/op 6 allocs/op | ||
BenchmarkFilter_Volumes/slice=10/filter=10-8 4603394 1299 ns/op 368 B/op 11 allocs/op | ||
BenchmarkFilter_Volumes/slice=10/filter=100-8 490940 11025 ns/op 3248 B/op 101 allocs/op | ||
BenchmarkFilter_Volumes/slice=100/filter=1-8 5878351 1015 ns/op 80 B/op 2 allocs/op | ||
BenchmarkFilter_Volumes/slice=100/filter=5-8 1290842 4663 ns/op 208 B/op 6 allocs/op | ||
BenchmarkFilter_Volumes/slice=100/filter=10-8 698023 8287 ns/op 368 B/op 11 allocs/op | ||
BenchmarkFilter_Volumes/slice=100/filter=100-8 87264 67737 ns/op 3248 B/op 101 allocs/op | ||
BenchmarkFilter_Volumes/slice=1000/filter=1-8 598560 9192 ns/op 80 B/op 2 allocs/op | ||
BenchmarkFilter_Volumes/slice=1000/filter=5-8 157719 44673 ns/op 208 B/op 6 allocs/op | ||
BenchmarkFilter_Volumes/slice=1000/filter=10-8 81381 78245 ns/op 368 B/op 11 allocs/op | ||
BenchmarkFilter_Volumes/slice=1000/filter=100-8 8083 636071 ns/op 3248 B/op 101 allocs/op | ||
PASS | ||
ok github.com/meian/gcf/bench 81.086s |