rakelimit icon indicating copy to clipboard operation
rakelimit copied to clipboard

replace bpf_ktime_get_ns with faster bpf_jiffies64

Open lmb opened this issue 4 years ago • 0 comments

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?

lmb avatar Jan 19 '21 09:01 lmb