(b *testing.B)
| 491 | } |
| 492 | |
| 493 | func BenchmarkEngine_DatabaseWithLockFreeMap(b *testing.B) { |
| 494 | var v atomic.Value |
| 495 | lm := make(map[string]*database) |
| 496 | for _, dn := range testDatabaseNames { |
| 497 | lm[dn] = &database{} |
| 498 | } |
| 499 | v.Store(lm) |
| 500 | // 3.895 ns |
| 501 | b.RunParallel(func(pb *testing.PB) { |
| 502 | for pb.Next() { |
| 503 | thisMap := v.Load().(map[string]*database) |
| 504 | _ = thisMap["application"] |
| 505 | } |
| 506 | }) |
| 507 | } |
| 508 | |
| 509 | func BenchmarkEngine_DatabaseWithLockFreeSlice(b *testing.B) { |
| 510 | type entry struct { |