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

bench: add new micro benchmark about maps and read/write userspace memory #334

Merged
merged 6 commits into from
Aug 17, 2024

Conversation

yunwei37
Copy link
Member

Description

  • Add benchmark about maps
  • Improve bench document

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@yunwei37 yunwei37 force-pushed the add-read-write-result branch from d1e50a1 to bfc0447 Compare August 16, 2024 21:03
@yunwei37 yunwei37 requested a review from Officeyutong August 17, 2024 00:09
@yunwei37
Copy link
Member Author

There are some performance problems we need to fix @Officeyutong

@Officeyutong
Copy link
Contributor

There are some performance problems we need to fix @Officeyutong

What are behaviors of these issues?

@yunwei37 yunwei37 merged commit b54598e into master Aug 17, 2024
133 checks passed
@yunwei37 yunwei37 deleted the add-read-write-result branch August 17, 2024 13:37
@yunwei37
Copy link
Member Author

What do you mean behavior?

@Officeyutong
Copy link
Contributor

What do you mean behavior?

What are the performance issues?

@yunwei37
Copy link
Member Author

You can see from https://github.com/eunomia-bpf/bpftime/tree/master/benchmark#maps-operations

The benchmark without inline the map op function:

Map Operation Kernel (op - uprobe) (ns) Userspace (op - uprobe) (ns)
__bench_hash_map_update 62827.533320 30296.051630
__bench_hash_map_lookup 15895.166920 23005.369380
__bench_hash_map_delete 19884.933980 13054.965970
__bench_array_map_update 9538.564600 6701.987970
__bench_array_map_lookup 183.155140 4305.515170
__bench_array_map_delete 216.088950 5987.507820
__bench_per_cpu_hash_map_update 33140.184290 95537.666900
__bench_per_cpu_hash_map_lookup 14089.238230 62913.855920
__bench_per_cpu_hash_map_delete 19753.563580 459826.428910
__bench_per_cpu_array_map_update 8885.238500 25728.928170
__bench_per_cpu_array_map_lookup 1838.737400 8759.420790
__bench_per_cpu_array_map_delete 1867.948100 4802.404130

@yunwei37
Copy link
Member Author

Those costs are much higher than kernel eBPF maps

  • per-cpu map op, include hash and array map
  • array_map op (because we don't inline the map op)

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

Successfully merging this pull request may close these issues.

2 participants