cloudflare / cloudflare/rakelimit

replace bpf_ktime_get_ns with faster bpf_jiffies64

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.