MCPcopy
hub / github.com/google/gopacket / BenchmarkPacketString

Function BenchmarkPacketString

layers/decode_test.go:361–368  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

359}
360
361func BenchmarkPacketString(b *testing.B) {
362 b.StopTimer()
363 p := gopacket.NewPacket(testSimpleTCPPacket, LinkTypeEthernet, testDecodeOptions)
364 b.StartTimer()
365 for i := 0; i < b.N; i++ {
366 _ = p.String()
367 }
368}
369
370func BenchmarkPacketDumpString(b *testing.B) {
371 b.StopTimer()

Callers

nothing calls this directly

Calls 2

StringMethod · 0.95
NewPacketFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…