diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-07 12:28:35 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-07 14:05:48 -0700 |
commit | 47549aa3d10808c063d45dcaa598887dadde59c5 (patch) | |
tree | 4ae21bf95c9f3b4cce97a0a0473fe622fdb393eb /internal/jsonstruct/struct.go | |
parent | 643cbc4d6e37d07619bec05039da1abb411d28d4 (diff) |
compat: Enable the cache benchmark
This should have been done back in 8aa12d3 (struct.go: Cache
structIndexes, 2023-01-26)
Diffstat (limited to 'internal/jsonstruct/struct.go')
-rw-r--r-- | internal/jsonstruct/struct.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/jsonstruct/struct.go b/internal/jsonstruct/struct.go index 830dc80..16c45de 100644 --- a/internal/jsonstruct/struct.go +++ b/internal/jsonstruct/struct.go @@ -37,6 +37,10 @@ func IndexStruct(typ reflect.Type) StructIndex { return ret } +func ClearCache() { + structIndexCache = typedsync.CacheMap[reflect.Type, StructIndex]{} +} + // indexStructReal is like indexStruct, but is the real indexer, // bypassing the cache. func indexStructReal(typ reflect.Type) StructIndex { |