Skip to content

Opportunity: bpf iterators for massive speed-up? #1836

Description

@eMPee584

On a linux system with around 250 Procs it took the procfs implemention 5.45ms vs 75.6us for bpf (bpf is ~72x faster). On a linux system with around 10,000 Procs it took the procfs implemention ~296ms ms vs 3ms for bpf (bpf is ~100x faster).

The performance difference comes from several key factors. Procfs reading requires multiple system calls per process. BPF iterators use just one system call regardless of process count. Each system call involves user/kernel context switches. BPF iterators eliminate this per-process overhead by running entirely in kernel space until completion. Also BPF programs access kernel data structures directly, this eliminates file system overhead and buffer copying.

https://www.grant.pizza/blog/bpf-iter/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linux 🐧Linux related issuesenhancementExtension or improvement to existing featurefeature requestCompletely new feature requestedneeds-discussion 🤔Changes need to be discussed and require consentquestion ❔Further information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions