cloudflare / cloudflare/rakelimit
replace bpf_ktime_get_ns with faster bpf_jiffies64
Open
enhancement
- Dominant language
- C
- Stars
- 211
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
The single call to `bpf_ktime_get_ns` uses about 30% of benchmark time on my machine. It would be a big perf win if we can replace it with something else.
There is a function `bpf_jiffies64` which is probably cheaper, but less accurate. Open questions:
- What is the resolution we can get from jiffies64, and is that enough for our purposes?
- How do we convert jiffies64 to a timestamp?
Contributor guide
Assessment
This issue has not been assessed yet.