Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent heap allocations in FiveTuple Fingerprint #393

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

paulwe
Copy link
Contributor

@paulwe paulwe commented Apr 20, 2024

No description provided.

Copy link

codecov bot commented Apr 20, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 68.27%. Comparing base (8958518) to head (9616801).

Files Patch % Lines
internal/allocation/five_tuple.go 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
- Coverage   68.40%   68.27%   -0.14%     
==========================================
  Files          43       43              
  Lines        2333     2348      +15     
==========================================
+ Hits         1596     1603       +7     
- Misses        573      578       +5     
- Partials      164      167       +3     
Flag Coverage Δ
go 68.27% <88.88%> (-0.14%) ⬇️
wasm 27.93% <72.22%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paulwe paulwe force-pushed the five-tuple-fingerprint branch 3 times, most recently from d388113 to c417edb Compare April 20, 2024 01:38
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this will be a solid speedup

@paulwe paulwe merged commit 55407d5 into master Apr 20, 2024
15 checks passed
@paulwe paulwe deleted the five-tuple-fingerprint branch April 20, 2024 02:10
@rg0now
Copy link
Contributor

rg0now commented Apr 20, 2024

We've already tried to track this down with @stv0g, see #299 and #304. This seems like a much better solution and the immediate effect is indeed massive performance improvement in GetAllocation based on my benchmarks (go test -cpuprofile cpu_895851.prof -bench=. -run=XXX -benchtime=200000x).

GetAllocation before the merge: UDPAddr.String dominates performance.
profile_895851

GetAllocation after the merge: FiveTupeFingerprint got supercheap.
profile_55407d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants