| "v.io/x/ref/lib/testutil/benchmark" |
| tsecurity "v.io/x/ref/lib/testutil/security" |
| "v.io/x/ref/profiles/internal/ipc/stream/manager" |
| _ "v.io/x/ref/profiles/static" |
| // benchmarkDialVC measures VC creation time over the underlying VIF. |
| func benchmarkDialVC(b *testing.B, mode options.VCSecurityLevel) { |
| stats := benchmark.AddStats(b, 16) |
| server := manager.InternalNew(naming.FixedRoutingID(0x5)) |
| client := manager.InternalNew(naming.FixedRoutingID(0xc)) |
| _, ep, err := server.Listen("tcp", "127.0.0.1:0", tsecurity.NewPrincipal("test"), mode) |
| // Warmup to create the underlying VIF. |
| _, err = client.Dial(ep, mode) |
| b.ResetTimer() // Exclude setup time from measurement. |
| for i := 0; i < b.N; i++ { |
| _, err := client.Dial(ep, mode) |
| duration := time.Since(start) |
| client.ShutdownEndpoint(ep) |