MCPcopy
hub / github.com/lindb/lindb / BenchmarkEngine_DatabaseWithSyncMap

Function BenchmarkEngine_DatabaseWithSyncMap

tsdb/engine_test.go:479–491  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

477}
478
479func BenchmarkEngine_DatabaseWithSyncMap(b *testing.B) {
480 var sm sync.Map
481 for _, dn := range testDatabaseNames {
482 sm.Store(dn, &database{})
483 }
484 // 9.365 ns
485 b.RunParallel(func(pb *testing.PB) {
486 for pb.Next() {
487 item, _ := sm.Load("application")
488 _ = item.(*database)
489 }
490 })
491}
492
493func BenchmarkEngine_DatabaseWithLockFreeMap(b *testing.B) {
494 var v atomic.Value

Callers

nothing calls this directly

Calls 2

NextMethod · 0.65
LoadMethod · 0.65

Tested by

no test coverage detected