vmware / go-ipfix

An ipfix library in Go
Other
39 stars 27 forks source link

Add new Go Benchmarks #329

Closed antoninbas closed 11 months ago

antoninbas commented 11 months ago

A few new benchmarks, which can be useful when validating improvements to the implementation.

codecov[bot] commented 11 months ago

Codecov Report

Merging #329 (58dd8ff) into main (614e68c) will not change coverage. The diff coverage is n/a.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/vmware/go-ipfix/pull/329/graphs/tree.svg?width=650&height=150&src=pr&token=448A94JZ59&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware)](https://app.codecov.io/gh/vmware/go-ipfix/pull/329?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware) ```diff @@ Coverage Diff @@ ## main #329 +/- ## ======================================= Coverage 73.67% 73.67% ======================================= Files 19 19 Lines 2800 2800 ======================================= Hits 2063 2063 Misses 572 572 Partials 165 165 ``` | [Flag](https://app.codecov.io/gh/vmware/go-ipfix/pull/329/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware) | Coverage Δ | | |---|---|---| | [integration-tests](https://app.codecov.io/gh/vmware/go-ipfix/pull/329/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware) | `53.82% <ø> (ø)` | | | [unit-tests](https://app.codecov.io/gh/vmware/go-ipfix/pull/329/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware) | `72.53% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vmware#carryforward-flags-in-the-pull-request-comment) to find out more.
antoninbas commented 11 months ago

@dreamtalen For BenchmarkAddRecord, I have also observed that. It's because the IPv4 benchmarks is not the same as the IPv6 one (more checks). Although I will update it so that they do the same. It doesn't really make sense to have them be different.

For BenchmarkAggregateMsgByFlowKey, the IPv4 one is faster for me, as expected.

BenchmarkAggregateMsgByFlowKey/ipv4-12            181294          6341 ns/op         696 B/op         12 allocs/op
BenchmarkAggregateMsgByFlowKey/ipv6-12            164910          7327 ns/op         792 B/op         13 allocs/op
antoninbas commented 11 months ago

@dreamtalen I unified the test code, PTAL

For BenchmarkAggregateMsgByFlowKey, you could give it another try (I recommend adding -test.benchmem as well). Your computer may have been running something else at the time.

dreamtalen commented 11 months ago

@dreamtalen I unified the test code, PTAL

For BenchmarkAggregateMsgByFlowKey, you could give it another try (I recommend adding -test.benchmem as well). Your computer may have been running something else at the time.

Thank you. As expected, the IPv4 one now performs slightly better in both benchmark tests.