We are parsing hundreds to thousands IPFIX packets per second and our CPU load was too high for such packet rate. With perf I found that problem is dbg! macros in IPFIX parse_bytes:
Commenting out these macros resulted in about 90% less CPU load. Reason for such load is that dbg! macro treats each vec item as separate message to stderr.
To fix this dbg! macros should be replaced with log::debug! or log::trace! or at least dbg! output should be changed to one line per vec.
We are parsing hundreds to thousands IPFIX packets per second and our CPU load was too high for such packet rate. With perf I found that problem is dbg! macros in IPFIX parse_bytes:
https://github.com/mikemiles-dev/netflow_parser/blob/ad41358d0c21eeaf3c997dd8f90070a9d35412d6/src/variable_versions/ipfix.rs#L336 https://github.com/mikemiles-dev/netflow_parser/blob/ad41358d0c21eeaf3c997dd8f90070a9d35412d6/src/variable_versions/ipfix.rs#L341
Commenting out these macros resulted in about 90% less CPU load. Reason for such load is that dbg! macro treats each vec item as separate message to stderr.
To fix this dbg! macros should be replaced with log::debug! or log::trace! or at least dbg! output should be changed to one line per vec.