Example #1
0
func BenchmarkParse(b *testing.B) {
	r := strings.NewReader(schemaJSON)
	for i := 0; i < b.N; i++ {
		s, _ := schema.Read(r)
		_ = s
	}
}
Example #2
0
func BenchmarkParseAndMakeValidator(b *testing.B) {
	r := strings.NewReader(schemaJSON)
	for i := 0; i < b.N; i++ {
		s, _ := schema.Read(r)
		v := validator.New(s)
		v.Compile() // force compiling for comparison
	}
}