- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for cachedTypeFields (0.27 sec)
-
src/encoding/json/bench_test.go
for nt := 1; nt <= maxTypes; nt *= 10 { // Pre-warm a cache of size nt. clearCache() for _, t := range types[:nt] { cachedTypeFields(t) } b.Run(fmt.Sprintf("HitTypes%d", nt), func(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { cachedTypeFields(types[0]) } }) }) } } func BenchmarkEncodeMarshaler(b *testing.B) { b.ReportAllocs()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 15:00:17 UTC 2024 - 12.5K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/third_party/forked/golang/json/fields.go
return field{}, false } return fields[0], true } var fieldCache struct { sync.RWMutex m map[reflect.Type][]field } // cachedTypeFields is like typeFields but uses a cache to avoid repeated work. func cachedTypeFields(t reflect.Type) []field { fieldCache.RLock() f := fieldCache.m[t] fieldCache.RUnlock() if f != nil { return f } // Compute fields without lock.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Jun 25 16:23:43 UTC 2022 - 13.1K bytes - Viewed (0) -
src/encoding/json/encode.go
return field{}, false } return fields[0], true } var fieldCache sync.Map // map[reflect.Type]structFields // cachedTypeFields is like typeFields but uses a cache to avoid repeated work. func cachedTypeFields(t reflect.Type) structFields { if f, ok := fieldCache.Load(t); ok { return f.(structFields) } f, _ := fieldCache.LoadOrStore(t, typeFields(t))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 00:18:55 UTC 2024 - 36.2K bytes - Viewed (0) -
src/encoding/json/decode.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 00:18:55 UTC 2024 - 35.3K bytes - Viewed (0)