Merged
Conversation
Now that we're on 1.23 we can use iterators. The existing iterators
don't really need to be modified. Allocations don't change, run time
seems a little bit faster.
core: 1
goos: linux
goarch: amd64
pkg: github.com/cilium/ebpf/btf
cpu: 13th Gen Intel(R) Core(TM) i7-1365U
│ base.txt │ iter.txt │
│ sec/op │ sec/op vs base │
PostorderTraversal/single_type 49.79n ± ∞ ¹ 48.68n ± ∞ ¹ -2.23% (p=0.029 n=4)
PostorderTraversal/cycle(1) 146.4n ± ∞ ¹ 135.8n ± ∞ ¹ -7.24% (p=0.029 n=4)
PostorderTraversal/cycle(10) 1.928µ ± ∞ ¹ 1.861µ ± ∞ ¹ -3.45% (p=0.029 n=4)
PostorderTraversal/gov_update_cpu_data 1.895m ± ∞ ¹ 1.907m ± ∞ ¹ ~ (p=0.057 n=4)
geomean 2.271µ 2.201µ -3.12%
¹ need >= 6 samples for confidence interval at level 0.95
Signed-off-by: Lorenz Bauer <[email protected]>
dylandreimerink
approved these changes
Feb 14, 2025
Member
dylandreimerink
left a comment
There was a problem hiding this comment.
Nice! Neat to see how close the existing implementation already was
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that we're on 1.23 we can use iterators. The existing iterators don't really need to be modified. Allocations don't change, run time seems a little bit faster.