Add performance tests for map operations from user mode#5067
Draft
Add performance tests for map operations from user mode#5067
Conversation
Co-authored-by: shankarseal <74580197+shankarseal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add performance tests for map operations from user mode
Add performance tests for map operations from user mode
Mar 2, 2026
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.
Description
Adds user-mode map operation performance tests to complement the existing kernel-side perf tests. The new tests exercise the libbpf-compatible API path (
bpf_map_create,bpf_map_lookup_elem,bpf_map_update_elem) through the mock execution stack, enabling measurement of the full user→kernel API overhead.New file:
tests/performance/UserMode.cppBPF_MAP_TYPE_HASH,BPF_MAP_TYPE_ARRAY,BPF_MAP_TYPE_PERCPU_HASH,BPF_MAP_TYPE_PERCPU_ARRAY,BPF_MAP_TYPE_LRU_HASHbpf_map_lookup_elemandbpf_map_update_elemfor all types; plus LRU-specific rolling update/lookup (eviction pressure) testssizeof(uint64_t) * cpu_countfor percpu maps) to isolate map op latency from allocator overhead_test_helper_end_to_end— same mock API stack pattern as unit/stress testsUpdated:
tests/performance/performance.vcxproj/.filtersUserMode.cpp,libs/thunk/mock/mock.cpp,tests/end_to_end/test_helper.cppapi,api_common,service,pe-parse,ebpfnetsh,prevail,bpf2c,test_util,common_tests,ubpf_user,rpc_interface) — mirrors the dependency set used by stress testsTesting
New tests are added in
UserMode.cppand integrated into the existingtests\performanceproject. Each map type × operation combination generates two Catch2 test cases (preemptible and non-preemptible), yielding 24 new perf test cases tagged[performance_UserMode].Documentation
No documentation impact.
Installation
No installer impact.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.