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

DNM: Batch APIS reproducer #1343

Closed
wants to merge 1 commit into from

Conversation

msherif1234
Copy link

@msherif1234 msherif1234 commented Feb 13, 2024

Using custom k and v to reproduce performance issues with BatchLookupAndDelete apis for perCPUHashmap

marshallers seems to have an issue if the fields of the key of different type ? u will get an error like e"[]ebpf.customKey doesn't marshal to 1600 bytes" aas an example if u have u32 and u64 fields in the key or value structures

 go test . -exec sudo -bench=BenchmarkCustomIterate  -benchmem -count 5 -run=^#
goos: linux
goarch: amd64
pkg: github.com/cilium/ebpf
cpu: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
BenchmarkCustomIterate/PerCPUHash/MapIteratorDelete-12         	    3397	    349858 ns/op	   40982 B/op	     304 allocs/op
BenchmarkCustomIterate/PerCPUHash/MapIteratorDelete-12         	    3410	    359623 ns/op	   40982 B/op	     304 allocs/op
BenchmarkCustomIterate/PerCPUHash/MapIteratorDelete-12         	    3447	    354813 ns/op	   40982 B/op	     304 allocs/op
BenchmarkCustomIterate/PerCPUHash/MapIteratorDelete-12         	    3302	    351545 ns/op	   40983 B/op	     304 allocs/op
BenchmarkCustomIterate/PerCPUHash/MapIteratorDelete-12         	    3481	    351126 ns/op	   40982 B/op	     304 allocs/op
BenchmarkCustomIterate/PerCPUHash/BatchLookupAndDelete-12      	    6835	    174716 ns/op	   22960 B/op	     106 allocs/op
BenchmarkCustomIterate/PerCPUHash/BatchLookupAndDelete-12      	    6793	    177632 ns/op	   22960 B/op	     106 allocs/op
BenchmarkCustomIterate/PerCPUHash/BatchLookupAndDelete-12      	    6626	    177139 ns/op	   22960 B/op	     106 allocs/op
BenchmarkCustomIterate/PerCPUHash/BatchLookupAndDelete-12      	    7083	    170590 ns/op	   22960 B/op	     106 allocs/op
BenchmarkCustomIterate/PerCPUHash/BatchLookupAndDelete-12      	    6824	    169559 ns/op	   22960 B/op	     106 allocs/op
PASS
ok  	github.com/cilium/ebpf	35.080s

Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant