tapirx
tapirx copied to clipboard
Don't rebuild the decoding stack for each packet
While experimenting with decoder stacks, I realized that we're reinitializing the decoder stack for each packet, in decodeLayers()
. This works against the performance benefit of gopacket.NewDecodingLayerParser
and is probably accidental.
The DecodingLayerParser
& decoder stack ([]gopacket.LayerType{}
) should be initialized once and either passed to decodeLayers()
as pointers or stored in globals.