ziglang / gotta-go-fast

Performance Tracking for Zig
MIT License
232 stars 15 forks source link

bench.zig: Re-open perf fds for each sample instead of re-using one for all samples #20

Closed squeek502 closed 2 years ago

squeek502 commented 2 years ago

PERF_EVENT_IOC_RESET doesn't seem to work properly when the inherit bit is set (which is set when the benchmark uses a child process). To get around this, we now close and re-open perf fds for each sample.

Closes #17


Note: This seems to be the better approach. I tried reading the fds before each sample and then subtracting the initial values from the final values, but I was running into intermittent cases where the end - start would end up as zero. With the approach in this PR, I haven't run into that (yet?).

andrewrk commented 2 years ago

Thanks for the 2 PRs! Re-running the backfill script now. Will make a note here when the new results are live.

andrewrk commented 2 years ago

New data is live. Thanks for the fixes! I also made the Y axes start at 0.

https://ziglang.org/perf/