iovisor / iovisor/bcc

improve bcc startup time

Open
#2,367 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

bcc takes about 4x the CPU time to startup than bpftrace. I would guess there's some low-hanging fruit with how it's compiled and using llvm/clang (which is what is taking all the time).

startup.py:

```
#!/usr/bin/python
from bcc import BPF
b = BPF(text="""
int kprobe__do_nanosleep()
{
return 0;
}""");
exit
```

```
# time ./startup.py

real 0m0.252s
user 0m0.138s
sys 0m0.026s
```

vs

```
# time bpftrace -e 'k:do_nanosleep { exit() }'
Attaching 1 probe...

real 0m0.122s
user 0m0.017s
sys 0m0.035s
```

You can run these through "perf record -F 1999 ..." to see what the startup costs are.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided startup.py benchmark and compare its timing with the bpftrace command. Use `perf record -F 1999` on both startup paths to identify where CPU time is spent, then verify that the BCC startup path is measurably faster without changing its probe behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
devtools, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.