Benchmark and performance evaluation for bpftime

The benchmark directory contains benchmarks and experiments for the bpftime project, including:

The benchmark directory contains benchmarks and experiments for the bpftime project, including:

  • Scripts for running experiments and generating figures
  • Benchmark environments for different use cases
  • Test code for performance evaluation

The benchmark is also tested for each commit in the CI: https://github.com/eunomia-bpf/bpftime/tree/master/.github/workflows/benchmarks.yml

The result will be published in https://eunomia-bpf.github.io/bpftime/benchmark/uprobe/results.html

You can check our OSDI paper Extending Applications Safely and Efficiently for more benchmark detail.

Getting Started

Install Dependencies

Please refer to our manual in bpftime build and test documentation for installing dependencies or using the Docker image.

The benchmark experiment scripts may automatically install dependencies and clone repos from the GitHub. Make sure you have Network access.

Run the experiments needs you have a Linux kernel with eBPF support, at lease 4 cores, and 16GB memory on x86_64 architecture.

Basic Usage

Check out the bpftime usage documentation for basic usage instructions. For the detail usage, please refer to each experiment directory.

Run All Experiments

before running the experiments, you also need to install some additional dependencies for the python scripts:

cd /path/to/bpftime
pip install -r benchmark/requirements.txt

then you can build and run the experiments by:

make benchmark # build the benchmark
make run-all-benchmark # run all benchmarks

(build time: 10min - 20min)

See the makefile for the details of the commands.

You can also check the CI for how we build the experiments and run them in .github/workflows/build-benchmarks.yml.

Experiments Overview

Experiment 1: Micro-benchmarks

This experiment measures the performance overhead and latency differences between bpftime and traditional kernel eBPF across various operations and use cases.

An example would be like:

Generated on 2025-04-30 0313. Environment

  • OS: Linux 6.11.0-24-generic
  • CPU: Intel(R) Core(TM) Ultra 7 258V (4 cores, 4 threads)
  • Memory: 15.07 GB
  • Python: 3.12.7

Core Uprobe Performance Summary

OperationKernel UprobeUserspace UprobeSpeedup
__bench_uprobe2561.57190.0213.48x
__bench_uretprobe3019.45187.1016.14x
__bench_uprobe_uretprobe3119.28191.6316.28x

Kernel vs Userspace eBPF Detailed Comparison

OperationEnvironmentMin (ns)Max (ns)Avg (ns)Std Dev
__bench_array_map_deleteKernel2725.993935.983237.62359.11
__bench_array_map_deleteUserspace2909.073285.523096.46114.99
__bench_array_map_lookupKernel2641.184155.252992.88402.00
__bench_array_map_lookupUserspace3354.173724.053486.81108.63
__bench_array_map_updateKernel9945.9714917.0312225.931508.60
__bench_array_map_updateUserspace4398.824841.924629.57152.57
__bench_hash_map_deleteKernel18560.9227069.9922082.682295.90
__bench_hash_map_deleteUserspace9557.3511240.7210253.54473.67
__bench_hash_map_lookupKernel10181.5813742.8612375.691142.61
__bench_hash_map_lookupUserspace20580.4623586.7722152.81969.63
__bench_hash_map_updateKernel43969.1361331.1653376.225497.51
__bench_hash_map_updateUserspace21172.0525878.4423992.671264.81
__bench_per_cpu_array_map_deleteKernel2782.473716.443183.09287.23
__bench_per_cpu_array_map_deleteUserspace2865.533409.703114.67140.65
__bench_per_cpu_array_map_lookupKernel2773.474176.103170.42416.42
__bench_per_cpu_array_map_lookupUserspace6269.587395.497018.47345.91
__bench_per_cpu_array_map_updateKernel10662.3715923.0812326.391522.21
__bench_per_cpu_array_map_updateUserspace15592.1517505.6316528.99553.50
__bench_per_cpu_hash_map_deleteKernel19709.2926844.9621994.952243.80
__bench_per_cpu_hash_map_deleteUserspace55954.8976124.0765603.075986.58
__bench_per_cpu_hash_map_lookupKernel10783.4815208.4612315.211525.86
__bench_per_cpu_hash_map_lookupUserspace48033.4657481.0950651.832503.34
__bench_per_cpu_hash_map_updateKernel31072.4643163.8135580.603748.51
__bench_per_cpu_hash_map_updateUserspace73661.6979157.1276526.241868.13
__bench_readKernel22506.8530934.2025865.433018.32
__bench_readUserspace1491.751862.131653.45101.66
__bench_uprobeKernel2130.544389.262561.57628.77
__bench_uprobeUserspace166.54232.13190.0216.11
__bench_uprobe_uretprobeKernel2658.283859.193119.28311.45
__bench_uprobe_uretprobeUserspace179.61202.69191.639.64
__bench_uretprobeKernel2581.483916.193019.45359.75
__bench_uretprobeUserspace175.54196.49187.107.66
__bench_writeKernel22783.5231415.4926478.922787.90
__bench_writeUserspace1406.011802.501542.49106.23

Part 1: bpftime vs eBPF

Performance comparison including:

You can check each directory for the details of the experiments, how to run them and the results.

(20min - 30 min computation time)

Part 2: Execution Engine Efficiency

This part evaluates the execution performance of different eBPF virtual machines and JIT compilers to compare their efficiency in running eBPF programs.

See the code used in our bpf-benchmark repository.

Part 3: Load Latency

This part measures the time required to load and attach eBPF programs.

The measurement tool is located in ../tools/cli/main.cpp.

Experiment 2: SSL/TLS Traffic Inspection (sslsniff)

This experiment demonstrates bpftime's capability to intercept and inspect SSL/TLS traffic in real-time by hooking into OpenSSL functions within nginx, measuring both performance impact and functionality.

Experiment 3: System Call Counting (syscount)

This experiment evaluates bpftime's ability to trace and count system calls made by applications like nginx, comparing the overhead and accuracy with kernel-based tracing.

Experiment 4: Nginx Plugin/Module

This experiment showcases how bpftime can be integrated as a plugin or module within nginx.

Experiment 5: DeepFlow

This experiment measures the performance impact of integrating bpftime with DeepFlow, an observability platform, to evaluate how userspace eBPF affects network monitoring and tracing workloads.

Performance evaluation for DeepFlow integration - see ./deepflow/ directory.

Experiment 6: FUSE (Filesystem in Userspace)

This experiment evaluates bpftime's performance when instrumenting FUSE-based filesystems to cache syscall results.

FUSE-related benchmarks - see ./fuse/ directory.

Experiment 7: Redis Durability Tuning

This experiment demonstrates how bpftime can be used to dynamically tune Redis durability settings at runtime, measuring the performance benefits of userspace extensions for database optimization.

Redis durability tuning benchmarks - see ./redis-durability-tuning/ directory.

Experiment 8: Compatibility

This experiment validates that existing eBPF programs can run seamlessly on both kernel eBPF and bpftime without modification, demonstrating the compatibility and portability of the userspace eBPF runtime.

Various compatibility examples that can run on both kernel eBPF and bpftime - see ../example directory.