Created
June 24, 2016 18:35
-
-
Save brianfoshee/c6c4e22c2bbc2ccd3768653e27ea0106 to your computer and use it in GitHub Desktop.
Revisions
-
brianfoshee created this gist
Jun 24, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ package main import ( "fmt" "testing" ) var result string func BenchmarkSprintf(b *testing.B) { for i := 0; i < b.N; i++ { result = fmt.Sprintf("%s, %s", "hello", "world") } } func BenchmarkStringConcat(b *testing.B) { for i := 0; i < b.N; i++ { result = "hello" + ", " + "world" } }