CI Benchmarking - #178
Conversation
…nto benchmark_final
Code Coverage ReportCurrent Coverage: 95.37% |
| } | ||
|
|
||
| pub fn clock_get_ms() -> i64 { | ||
| std::time::SystemTime::now() |
There was a problem hiding this comment.
You might want to be careful with using SystemTime, since it becomes a Linux syscall. There's some overhead there that you might not be able to ignore, depending on how long the tests take. It's better to use native CPU performance counters to read clocks / instructions processed instead.
There was a problem hiding this comment.
Okay I will look into it, thank you.
There was a problem hiding this comment.
@h313 Is there a qemu platform agnostic way to get these counters? Like some kind of c-lib we can link to and get these exposed.
There was a problem hiding this comment.
Seems like the cputicks crate might work for aarch64 and riscv64, but it doesn't have 32-bit ARM or RISC-V support.
But since it's just a single assembly instruction per target ISA that will never change until the ISA is deprecated, it should be pretty safe to use in the benchmark code.
WORK IN PROGRESS
making this draft PR early so the workflows run