| "v.io/core/veyron/lib/testutil/benchmark" |
| _ "v.io/core/veyron/profiles/static" |
| "v.io/core/veyron/runtimes/google/ipc/stream/manager" |
| "v.io/core/veyron2/naming" |
| "v.io/core/veyron2/options" |
| // 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", 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) |