Forked from maximelamure/gist:af411199bd5c93db3dd0a7133914ebc3
Last active
October 24, 2016 21:22
-
-
Save misakwa/0de125b97aba9f53632faebc9861e360 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
package bench_test | |
import "testing" | |
func BenchmarkByteArray(b *testing.B) { | |
for n := 0; n < b.N; n++ { | |
GetBytes() | |
} | |
} | |
func BenchmarkString(b *testing.B) { | |
for n := 0; n < b.N; n++ { | |
GetString() | |
} | |
} | |
func GetString() string { | |
filtersKey := make([]string, 0, 0) | |
filtersKey = append(filtersKey, "chunks = ?") | |
filtersKey = append(filtersKey, "error_message = ?") | |
filtersKey = append(filtersKey, "error_status = ?") | |
filtersKey = append(filtersKey, "status = ?") | |
return "" | |
} | |
func GetBytes() string { | |
var filtersKey []byte | |
filtersKey = append(filtersKey, "chunks = ?"...) | |
filtersKey = append(filtersKey, "error_message = ?"...) | |
filtersKey = append(filtersKey, "error_status = ?"...) | |
filtersKey = append(filtersKey, "status = ?"...) | |
return "" | |
} |
Author
misakwa
commented
Oct 24, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment