tapirx icon indicating copy to clipboard operation
tapirx copied to clipboard

Don't rebuild the decoding stack for each packet

Open ransford opened this issue 5 years ago • 0 comments

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.

ransford avatar Mar 11 '19 15:03 ransford