Closed natecraddock closed 1 year ago
Using hyperfine:
❯ ll zf-release-fast zf-release-safe
-rwxr-xr-x 1 nathan staff 380K Mar 9 20:42 zf-release-fast
-rwxr-xr-x 1 nathan staff 420K Mar 9 20:41 zf-release-safe
❯ wc -l files.txt
115566 files.txt
❯ hyperfine -w 3 'cat files.txt | ./zf-release-fast -f "filter.zig zf filter.zig"' 'cat files.txt | ./zf-release-safe -f "filter.zig zf filter.zig"'
Benchmark 1: cat files.txt | ./zf-release-fast -f "filter.zig zf filter.zig"
Time (mean ± σ): 23.2 ms ± 0.4 ms [User: 17.8 ms, System: 6.8 ms]
Range (min … max): 22.5 ms … 24.5 ms 118 runs
Benchmark 2: cat files.txt | ./zf-release-safe -f "filter.zig zf filter.zig"
Time (mean ± σ): 24.6 ms ± 0.4 ms [User: 19.3 ms, System: 6.7 ms]
Range (min … max): 24.0 ms … 26.8 ms 110 runs
Summary
'cat files.txt | ./zf-release-fast -f "filter.zig zf filter.zig"' ran
1.06 ± 0.03 times faster than 'cat files.txt | ./zf-release-safe -f "filter.zig zf filter.zig"'
I think the difference between 23.2 and 24.6 ms over 100,000+ lines is negligible. I also have performance optimizations planned for the 0.9.0 release anyway. I'll default to ReleaseSafe in the future.
The brew package was updated before I can get around to it. Whenever the Zig package manager and a zf release align I'll update the brew build script and switch it to ReleaseSafe
I did some basic tests and it seems that
ReleaseSafe
is only marginally slower thanReleaseFast
. I'll do a bit more investigation, but it seems like I should switch toReleaseSafe
just to be safe ;)Part of 0.8.0 but most (all) of the work takes place after the release tagging