Last active
October 11, 2015 05:48
-
-
Save arschles/ef4b5a9bf296f1d6d994 to your computer and use it in GitHub Desktop.
golang html/template Parse benchmark
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 tmplbench | |
import ( | |
"testing" | |
"html/template" | |
) | |
func BenchmarkTemplate(b *testing.B) { | |
tmpl := template.New("test") | |
b.ResetTimer() | |
for i := 0; i < b.N; i++ { | |
tmpl.Parse("Hello, {{.}}!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
benchmark test:
% go test -bench ./... ok github.com/arschles/go-http-handler 0.006s