~egtann/json2sql

a39075229301aaa3c3976c8de6af899f44e4fb35 — Evan Tann 8 months ago 5da4a46
add stream schema benchmark
1 files changed, 11 insertions(+), 0 deletions(-)

M json2sql_test.go
M json2sql_test.go => json2sql_test.go +11 -0
@@ 105,3 105,14 @@ func fixture(pth string) []byte {
	}
	return byt
}

func BenchmarkStreamSchema(b *testing.B) {
	have := bytes.TrimSpace(fixture("schema_consistent_types.json"))
	in := bytes.NewReader(have)
	out := bytes.NewBufferString("")
	for n := 0; n < b.N; n++ {
		streamSchema(in, out, false)
		in.Reset(have)
		out.Reset()
	}
}