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

Function BenchmarkDecodingLayerParserHandlePanic

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

Source from the content-addressed store, hash-verified

197}
198
199func BenchmarkDecodingLayerParserHandlePanic(b *testing.B) {
200 decoded := make([]gopacket.LayerType, 0, 20)
201 dlp := gopacket.NewDecodingLayerParser(LayerTypeEthernet, &Ethernet{}, &IPv4{}, &TCP{}, &gopacket.Payload{})
202 dlp.IgnorePanic = false
203 for i := 0; i < b.N; i++ {
204 dlp.DecodeLayers(testSimpleTCPPacket, &decoded)
205 }
206}
207
208func benchmarkDecodingLayerParser(b *testing.B, dlc gopacket.DecodingLayerContainer, ignorePanic bool) {
209 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…