MCPcopy Index your code
hub / github.com/google/gopacket / BenchmarkDecodingLayerParserIgnorePanic

Function BenchmarkDecodingLayerParserIgnorePanic

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

Source from the content-addressed store, hash-verified

188}
189
190func BenchmarkDecodingLayerParserIgnorePanic(b *testing.B) {
191 decoded := make([]gopacket.LayerType, 0, 20)
192 dlp := gopacket.NewDecodingLayerParser(LayerTypeEthernet, &Ethernet{}, &IPv4{}, &TCP{}, &gopacket.Payload{})
193 dlp.IgnorePanic = true
194 for i := 0; i < b.N; i++ {
195 dlp.DecodeLayers(testSimpleTCPPacket, &decoded)
196 }
197}
198
199func BenchmarkDecodingLayerParserHandlePanic(b *testing.B) {
200 decoded := make([]gopacket.LayerType, 0, 20)

Callers

nothing calls this directly

Calls 2

DecodeLayersMethod · 0.95
NewDecodingLayerParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…