Skip to content

Commit

Permalink
Removed benchmark for Decode
Browse files Browse the repository at this point in the history
  • Loading branch information
EinKrebs committed Oct 7, 2021
1 parent cb8ea18 commit cff2419
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,27 +182,6 @@ func BenchmarkUnicodeDecoder(b *testing.B) {
}
}

func BenchmarkDecoderStream(b *testing.B) {
b.ReportAllocs()
b.StopTimer()
var buf bytes.Buffer
buf.WriteString(`"` + strings.Repeat("x", 1000000) + `"` + "\n\n\n")
var x interface{}
if err := Unmarshal(&buf, &x); err != nil {
b.Fatal("Decode:", err)
}
ones := strings.Repeat(" 1\n", 300000) + "\n\n\n"
b.StartTimer()
for i := 0; i < b.N; i++ {
if i%300000 == 0 {
buf.WriteString(ones)
}
x = nil
require.NoError(b, Unmarshal(&buf, &x))
assert.Equal(b, 1.0, x)
}
}

func BenchmarkCodeUnmarshal(b *testing.B) {
b.ReportAllocs()
if codeJSON == nil {
Expand Down

0 comments on commit cff2419

Please sign in to comment.