Created
August 14, 2018 18:34
-
-
Save heat/b0e6133eda9bc29a913befa6c2e05749 to your computer and use it in GitHub Desktop.
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
func benchmarkFib(i int, b *testing.B) { | |
for n := 0; n < b.N; n++ { | |
Fib(i) | |
} | |
} | |
func BenchmarkFib1(b *testing.B) { benchmarkFib(1, b) } | |
func BenchmarkFib2(b *testing.B) { benchmarkFib(2, b) } | |
func BenchmarkFib3(b *testing.B) { benchmarkFib(3, b) } | |
func BenchmarkFib10(b *testing.B) { benchmarkFib(10, b) } | |
func BenchmarkFib20(b *testing.B) { benchmarkFib(20, b) } | |
func BenchmarkFib40(b *testing.B) { benchmarkFib(40, b) } |
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
go test -run=XXX -bench=. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment