Provide direct access to IPLayer
Closed this issue · 1 comments
fako1024 commented
Instead of having to retrieve a full packet, then call IPLayer()
it would be beneficial to provide direct access to the IPLayer without additional overhead / complexity.
fako1024 commented
Using the IPLayer
directly via the newly provided interface method NextIPLayer()
improves capture speed on goProbe
by about 14% (simply by reducing the additional call overhead for constructing / deconstructing the IP layer from the overall packet). Stack / zero-heap allocations are maintained.
BEFORE: Packets processed after 10s: 274923717 (36ns/pkt)
AFTER: Packets processed after 10s: 315290255 (31ns/pkt)