diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-07 14:06:12 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-07 14:06:12 -0700 |
commit | 480ccfd05a13ac36516c536a71203280a31b4d28 (patch) | |
tree | 4ae21bf95c9f3b4cce97a0a0473fe622fdb393eb /compat/json/borrowed_bench_test.go | |
parent | 87013d526ea1b0647ef6e08758fe587cee11d854 (diff) | |
parent | 47549aa3d10808c063d45dcaa598887dadde59c5 (diff) |
Merge branch 'lukeshu/fixup'
Diffstat (limited to 'compat/json/borrowed_bench_test.go')
-rw-r--r-- | compat/json/borrowed_bench_test.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/compat/json/borrowed_bench_test.go b/compat/json/borrowed_bench_test.go index e2d74ab..443a13d 100644 --- a/compat/json/borrowed_bench_test.go +++ b/compat/json/borrowed_bench_test.go @@ -15,9 +15,13 @@ package json import ( "bytes" "compress/gzip" + "fmt" "io" "os" + "reflect" + "runtime" "strings" + "sync" "testing" ) @@ -325,11 +329,10 @@ func BenchmarkUnmapped(b *testing.B) { }) } -/* // MODIFIED: we don't have a cache func BenchmarkTypeFieldsCache(b *testing.B) { b.ReportAllocs() var maxTypes int = 1e6 - if testenv.Builder() != "" { + if false { // testenv.Builder() != "" { // MODIFIED: disabled maxTypes = 1e3 // restrict cache sizes on builders } @@ -345,9 +348,9 @@ func BenchmarkTypeFieldsCache(b *testing.B) { } // clearClear clears the cache. Other JSON operations, must not be running. - clearCache := func() { - fieldCache = sync.Map{} - } + // clearCache := func() { // MODIFIED: use function from compat_test.go + // fieldCache = sync.Map{} // MODIFIED: use function from compat_test.go + // } // MODIFIED: use function from compat_test.go // MissTypes tests the performance of repeated cache misses. // This measures the time to rebuild a cache of size nt. @@ -389,7 +392,6 @@ func BenchmarkTypeFieldsCache(b *testing.B) { }) } } -*/ // MODIFIED: we don't have a cache func BenchmarkEncodeMarshaler(b *testing.B) { b.ReportAllocs() |