|
|
|
|
|
by vlovich123
817 days ago
|
|
Good hunch. On my machine (13900k) & zig 0.11, the latest version of the code: > INFILE="$(mktemp)" && echo $INFILE && \
echo '60016000526001601ff3' | xxd -r -p > "${INFILE}" && \
zig build run -Doptimize=ReleaseFast < "${INFILE}"
> execution time: 27.742µs vs > echo '60016000526001601ff3' | xxd -r -p | zig build run -Doptimize=ReleaseFast
> execution time: 27.999µs The idea that the overlap of execution here by itself plays a role is nonsensical. The overlap of execution + reading a byte at a time causing kernel mutex contention seems like a more plausible explanation although I would expect someone better knowledgeable (& more motivated) about capturing kernel perf measurements to confirm. If this is the explanation, I'm kind of surprised that there isn't a lock-free path for pipes in the kernel. |
|
Here are the benchmarks before and after fixing the benchmarking code:
Before: https://output.circle-artifacts.com/output/job/2f6666c1-1165...
After: https://output.circle-artifacts.com/output/job/457cd247-dd7c...
What would explain the drastic performance increase if the pipelining behavior is irrelevant?