Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 1.18 vs 1.19 benchmarks #121

Closed
benhoyt opened this issue May 20, 2022 · 1 comment
Closed

Go 1.18 vs 1.19 benchmarks #121

benhoyt opened this issue May 20, 2022 · 1 comment

Comments

@benhoyt
Copy link
Owner

benhoyt commented May 20, 2022

I ran benchmarks of commit 15df9e7 against go1.18.1 and go1.19-c087121daf. This includes the jump tables improvements in Go 1.19. It's definitely a bit faster overall, though there are some odd decreases in a few microbenchmarks. Microbenchmarks are 1% faster overall, and macrobenchmarks are 3.4% faster overall. See also https://groups.google.com/g/golang-dev/c/RLu6bS3dDeA/m/4cvbAt10AAAJ

name                    old time/op  new time/op   delta
ConcatLarge-8           1.64ms ± 2%   2.00ms ± 1%  +21.94%  (p=0.008 n=5+5)
IncrDecr-8               137ns ± 4%    163ns ± 1%  +19.10%  (p=0.008 n=5+5)
ArrayOperations-8        532ns ± 2%    606ns ± 1%  +13.87%  (p=0.008 n=5+5)
RepeatNew-8             96.6ns ± 2%  103.1ns ± 1%   +6.68%  (p=0.008 n=5+5)
IfStatement-8            147ns ± 2%    156ns ± 2%   +6.52%  (p=0.008 n=5+5)
CondExpr-8               147ns ± 1%    155ns ± 4%   +5.59%  (p=0.008 n=5+5)
BuiltinMatch-8          2.63µs ± 1%   2.62µs ± 2%     ~     (p=0.548 n=5+5)
BuiltinSplitSpace-8     34.9µs ± 1%   35.0µs ± 1%     ~     (p=0.310 n=5+5)
BuiltinSplitRegex-8     90.0µs ± 4%   91.7µs ± 4%     ~     (p=0.421 n=5+5)
BuiltinSubAmpersand-8   14.0µs ± 4%   13.9µs ± 5%     ~     (p=0.841 n=5+5)
BuiltinGsub-8           17.1µs ± 6%   16.1µs ± 1%     ~     (p=0.056 n=5+5)
BuiltinGsubAmpersand-8  16.7µs ± 3%   16.8µs ±11%     ~     (p=0.841 n=5+5)
SimplePattern-8          130ns ± 2%    129ns ± 3%     ~     (p=0.841 n=5+5)
GetField-8               326ns ± 2%    327ns ± 3%     ~     (p=0.548 n=5+5)
SetField-8               815ns ± 5%    783ns ± 2%     ~     (p=0.056 n=5+5)
ConcatSmall-8            346ns ± 4%    346ns ± 5%     ~     (p=0.841 n=5+5)
RepeatExecProgram-8     13.8µs ± 5%   13.5µs ± 3%     ~     (p=0.548 n=5+5)
RepeatIONew-8           1.06µs ± 1%   1.12µs ±18%     ~     (p=0.167 n=5+5)
CSVInputGoAWK-8          400ns ± 1%    396ns ± 8%     ~     (p=0.841 n=5+5)
CSVInputReader-8         273ns ± 6%    289ns ± 8%     ~     (p=0.421 n=5+5)
CSVOutputGoAWK-8         377ns ± 2%    383ns ± 6%     ~     (p=0.690 n=5+5)
CSVOutputWriter-8        226ns ± 6%    237ns ± 3%     ~     (p=0.222 n=5+5)
NativeFunc-8            10.1µs ± 0%   10.0µs ± 1%   -1.39%  (p=0.008 n=5+5)
ForInLoop-8             1.71µs ± 2%   1.68µs ± 1%   -2.00%  (p=0.048 n=5+5)
RegexMatch-8            1.06µs ± 1%   1.03µs ± 2%   -2.39%  (p=0.016 n=5+5)
AugAssign-8              972ns ± 1%    947ns ± 1%   -2.56%  (p=0.008 n=5+5)
RepeatIOExecProgram-8   23.7µs ± 1%   23.0µs ± 1%   -2.89%  (p=0.008 n=5+5)
FuncCall-8              2.68µs ± 2%   2.60µs ± 3%   -3.20%  (p=0.032 n=5+5)
RecursiveFunc-8         14.5µs ± 1%   14.0µs ± 2%   -3.24%  (p=0.008 n=5+5)
Printf-8                4.45µs ± 1%   4.28µs ± 1%   -3.82%  (p=0.008 n=5+5)
BuiltinSprintf-8        8.10µs ± 1%   7.79µs ± 3%   -3.83%  (p=0.016 n=5+5)
LocalVars-8              275ns ± 1%    264ns ± 0%   -3.91%  (p=0.008 n=5+5)
BinaryOperators-8        414ns ± 1%    397ns ± 1%   -4.19%  (p=0.016 n=5+4)
BuiltinIndex-8           991ns ± 1%    949ns ± 2%   -4.28%  (p=0.008 n=5+5)
BuiltinSub-8            14.1µs ± 8%   13.5µs ± 1%   -4.87%  (p=0.008 n=5+5)
ConcatTwo-8              102ns ± 2%     96ns ± 4%   -5.26%  (p=0.008 n=5+5)
ForLoop-8               2.37µs ± 1%   2.24µs ± 2%   -5.41%  (p=0.008 n=5+5)
Print-8                 2.34µs ± 1%   2.20µs ± 1%   -5.92%  (p=0.008 n=5+5)
Comparisons-8            320ns ± 2%    297ns ± 3%   -7.14%  (p=0.008 n=5+5)
BuiltinSubstr-8          742ns ± 1%    684ns ± 1%   -7.80%  (p=0.008 n=5+5)
BuiltinLength-8          420ns ± 1%    387ns ± 1%   -7.97%  (p=0.008 n=5+5)
SimpleBuiltins-8         726ns ± 2%    667ns ± 1%   -8.16%  (p=0.008 n=5+5)
GlobalVars-8             279ns ± 1%    251ns ± 1%  -10.09%  (p=0.008 n=5+5)
Assign-8                 274ns ± 2%    238ns ± 0%  -13.38%  (p=0.008 n=5+5)
[Geo mean]              1.49µs        1.47µs        -0.95%
Test goawk orig awk gawk mawk
tt.01 (print) 2.05 1.88 1.00 1.86 2.56
tt.02 (print NR NF) 1.71 1.71 1.00 1.78 1.69
tt.02a (print length) 1.37 1.44 1.00 1.66 2.02
tt.03 (sum length) 1.25 1.24 1.00 3.93 1.84
tt.03a (sum field) 1.29 1.14 1.00 4.22 1.79
tt.04 (printf fields) 1.08 1.06 1.00 1.64 2.58
tt.05 (concat fields) 1.20 1.13 1.00 1.60 2.28
tt.06 (count lengths) 1.42 1.38 1.00 2.62 1.98
tt.07 (even fields) 1.24 1.03 1.00 1.59 1.69
tt.08 (even lengths) 2.02 2.20 1.00 1.24 2.74
tt.08z (regex simple) 3.13 3.24 1.00 2.75 6.18
tt.09 (regex starts with) 2.40 2.18 1.00 2.47 5.84
tt.10 (regex ends with) 0.41 0.38 1.00 1.56 3.59
tt.10a (regex ends with var) 0.38 0.35 1.00 1.38 3.03
tt.11 (substr) 2.68 2.45 1.00 1.23 3.99
tt.12 (update fields) 1.24 1.23 1.00 1.71 1.77
tt.13 (array ops) 4.07 3.93 1.00 3.12 6.15
tt.13a (array printf) 2.81 2.73 1.00 2.14 4.88
tt.14 (function call) 1.33 1.32 1.00 0.67 1.67
tt.15 (format lines) 0.69 0.65 1.00 0.95 2.25
tt.16 (count words) 1.58 1.53 1.00 1.25 2.10
tt.big (complex program) 1.96 1.90 1.00 2.02 3.70
tt.x1 (mandelbrot) 2.21 2.27 1.00 1.32 3.50
tt.x2 (sum loop) 1.70 1.70 1.00 1.07 2.65
---------------------------- -------- -------- -------- -------- --------
Geo mean 1.50 1.45 1.00 1.74 2.75
@benhoyt
Copy link
Owner Author

benhoyt commented May 20, 2022

Nothing to do here, this is just for the record, so closing.

@benhoyt benhoyt closed this as completed May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant