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

Update benchmarked libraries to latest version #992

Closed

Conversation

kishaningithub
Copy link

@kishaningithub kishaningithub commented Aug 22, 2021

Update benchmarked libraries to latest stable version

@CLAassistant
Copy link

CLAassistant commented Aug 22, 2021

CLA assistant check
All committers have signed the CLA.

@kishaningithub
Copy link
Author

[Question] Is there a common pipeline which runs these benchmark tests? If not, i think we need one

@karuppiah7890
Copy link

Maybe Update zap to latest version commit can be squashed into the Update benchmarked libraries to latest version commit as Update benchmarked libraries to latest version seems to take care of the versions of all the libraries

@karuppiah7890
Copy link

[Question] Is there a common pipeline which runs these benchmark tests? If not, i think we need one

I just checked the GitHub Actions workflow and noticed make bench here

https://github.com/uber-go/zap/blob/master/.github/workflows/go.yml#L52

Looks like it runs the benchmark tests in all the Golang module directories including benchmarks directory

zap $ make bench
go: downloading go.uber.org/goleak v1.1.11-0.20210813005559-691160354723
goos: darwin
goarch: amd64
pkg: go.uber.org/zap
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkBoolsArrayMarshaler-16    	 1180323	      1002 ns/op	    1129 B/op	       4 allocs/op
BenchmarkBoolsReflect-16           	  585409	      2119 ns/op	    2270 B/op	       7 allocs/op
BenchmarkNoContext-16              	18738148	        66.98 ns/op	       0 B/op	       0 allocs/op
BenchmarkBoolField-16              	 9396064	       119.5 ns/op	      64 B/op	       1 allocs/op
BenchmarkByteStringField-16        	 8500279	       142.6 ns/op	      88 B/op	       2 allocs/op
BenchmarkFloat64Field-16           	 9024106	       129.5 ns/op	      64 B/op	       1 allocs/op
BenchmarkIntField-16               	10714106	       110.0 ns/op	      64 B/op	       1 allocs/op
BenchmarkInt64Field-16             	10218261	       115.8 ns/op	      64 B/op	       1 allocs/op
BenchmarkStringField-16            	10801838	       110.4 ns/op	      64 B/op	       1 allocs/op
BenchmarkStringerField-16          	10386373	       111.6 ns/op	      64 B/op	       1 allocs/op
BenchmarkTimeField-16              	10607216	       113.6 ns/op	      64 B/op	       1 allocs/op
BenchmarkDurationField-16          	10699279	       113.3 ns/op	      64 B/op	       1 allocs/op
BenchmarkErrorField-16             	 9948448	       123.4 ns/op	      64 B/op	       1 allocs/op
BenchmarkErrorsField-16            	 5180038	       235.8 ns/op	      88 B/op	       2 allocs/op
BenchmarkStackField-16             	 1618772	       727.3 ns/op	     627 B/op	       3 allocs/op
BenchmarkObjectField-16            	 7460868	       160.4 ns/op	      64 B/op	       1 allocs/op
BenchmarkReflectField-16           	 3890060	       304.6 ns/op	     193 B/op	       3 allocs/op
BenchmarkAddCallerHook-16          	 4040864	       298.0 ns/op	     249 B/op	       3 allocs/op
Benchmark10Fields-16               	 3816541	       310.2 ns/op	     643 B/op	       1 allocs/op
Benchmark100Fields-16              	  189855	      6092 ns/op	    1250 B/op	       5 allocs/op
BenchmarkTakeStacktrace-16         	  678018	      1608 ns/op	     496 B/op	       2 allocs/op
BenchmarkSugarSingleStrArg-16      	 1981016	       511.6 ns/op	     815 B/op	       0 allocs/op
PASS
ok  	go.uber.org/zap	31.784s
goos: darwin
goarch: amd64
pkg: go.uber.org/zap/buffer
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkBuffers/ByteSlice-16         	84231436	        14.33 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuffers/BytesBuffer-16       	64144861	        19.06 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuffers/CustomBuffer-16      	74882232	        15.21 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	go.uber.org/zap/buffer	5.923s
?   	go.uber.org/zap/internal/bufferpool	[no test files]
PASS
ok  	go.uber.org/zap/internal/color	0.494s
PASS
ok  	go.uber.org/zap/internal/exit	0.510s
?   	go.uber.org/zap/internal/readme	[no test files]
?   	go.uber.org/zap/internal/ztest	[no test files]
go: downloading github.com/benbjohnson/clock v1.1.0
go: downloading gopkg.in/yaml.v2 v2.2.8
goos: darwin
goarch: amd64
pkg: go.uber.org/zap/zapcore
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkBufferedWriteSyncer/write_file_with_buffer-16         	10494157	       110.2 ns/op	      16 B/o       1 allocs/op
BenchmarkMultiWriteSyncer/2_discarder-16                       	121240663	        10.73 ns/op	      16 B/o       1 allocs/op
BenchmarkMultiWriteSyncer/4_discarder-16                       	100000000	        11.86 ns/op	      16 B/o       1 allocs/op
BenchmarkMultiWriteSyncer/4_discarder_with_buffer-16           	11572149	       102.9 ns/op	      16 B/o       1 allocs/op
BenchmarkWriteSyncer/write_file_with_no_buffer-16              	  276162	      4425 ns/op	      16 B/o       1 allocs/op
BenchmarkZapConsole-16                                         	 1868610	       620.3 ns/op	    1359 B/o       7 allocs/op
BenchmarkJSONLogMarshalerFunc-16                               	 1605710	       758.6 ns/op	    1313 B/o       5 allocs/op
BenchmarkZapJSON-16                                            	 2552557	       516.7 ns/op	    1250 B/o       3 allocs/op
BenchmarkStandardJSON-16                                       	 1000000	      1087 ns/op	    1434 B/o      27 allocs/op
BenchmarkSampler_Check/7_keys-16                               	139434873	         8.359 ns/op	       0 B/o       0 allocs/op
BenchmarkSampler_Check/50_keys-16                              	152317328	         7.858 ns/op	       0 B/o       0 allocs/op
BenchmarkSampler_Check/100_keys-16                             	147622794	         8.275 ns/op	       0 B/o       0 allocs/op
BenchmarkSampler_CheckWithHook/7_keys-16                       	52573616	        22.20 ns/op	       0 B/o       0 allocs/op
BenchmarkSampler_CheckWithHook/50_keys-16                      	46891059	        23.95 ns/op	       0 B/o       0 allocs/op
BenchmarkSampler_CheckWithHook/100_keys-16                     	49351936	        23.82 ns/op	       0 B/o       0 allocs/op
BenchmarkTeeCheck-16                                           	 7870606	       163.4 ns/op	      64 B/o       1 allocs/op
PASS
ok  	go.uber.org/zap/zapcore	27.087s
PASS
ok  	go.uber.org/zap/zapgrpc	0.501s
goos: darwin
goarch: amd64
pkg: go.uber.org/zap/zapio
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkWriter/single-16         	 3365644	       347.1 ns/op	      16 B/op	       2 allocs/op
BenchmarkWriter/splits-16         	 2822730	       412.9 ns/op	      16 B/op	       2 allocs/op
PASS
ok  	go.uber.org/zap/zapio	3.621s
PASS
ok  	go.uber.org/zap/zaptest	0.497s
PASS
ok  	go.uber.org/zap/zaptest/observer	0.495s
go: downloading gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec
go: downloading github.com/rs/zerolog v1.16.0
go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading github.com/apex/log v1.1.1
goos: darwin
goarch: amd64
pkg: go.uber.org/zap/benchmarks
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkDisabledWithoutFields/Zap-16     	1000000000	         1.100 ns/op	       0 B/op	       0 allocs/op
BenchmarkDisabledWithoutFields/Zap.Check-16         	1000000000	         0.9410 ns/op	       0 B/op	       0 allocs/op
BenchmarkDisabledWithoutFields/Zap.Sugar-16         	100000000	        10.75 ns/op	      16 B/op	       1 allocs/op
BenchmarkDisabledWithoutFields/Zap.SugarFormatting-16         	16417279	        66.62 ns/op	     136 B/o       6 allocs/op
BenchmarkDisabledWithoutFields/apex/log-16                    	1000000000	         0.6567 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledWithoutFields/sirupsen/logrus-16             	148844791	         7.723 ns/op	      16 B/o       1 allocs/op
BenchmarkDisabledWithoutFields/rs/zerolog-16                  	1000000000	         0.5260 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledAccumulatedContext/Zap-16                    	1000000000	         1.137 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledAccumulatedContext/Zap.Check-16              	1000000000	         1.009 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledAccumulatedContext/Zap.Sugar-16              	127750041	         9.493 ns/op	      16 B/o       1 allocs/op
BenchmarkDisabledAccumulatedContext/Zap.SugarFormatting-16    	20082261	        58.08 ns/op	     136 B/o       6 allocs/op
BenchmarkDisabledAccumulatedContext/apex/log-16               	1000000000	         0.3754 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledAccumulatedContext/sirupsen/logrus-16        	162263330	         7.968 ns/op	      16 B/o       1 allocs/op
BenchmarkDisabledAccumulatedContext/rs/zerolog-16             	1000000000	         0.5110 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledAddingFields/Zap-16                          	 5975811	       208.5 ns/op	     736 B/o       5 allocs/op
BenchmarkDisabledAddingFields/Zap.Check-16                    	1000000000	         0.9219 ns/op	       0 B/o       0 allocs/op
BenchmarkDisabledAddingFields/Zap.Sugar-16                    	21711189	        57.75 ns/op	     136 B/o       6 allocs/op
BenchmarkDisabledAddingFields/apex/log-16                     	 2841742	       415.4 ns/op	    1174 B/o      11 allocs/op
BenchmarkDisabledAddingFields/sirupsen/logrus-16              	 2037914	       577.3 ns/op	    1526 B/o      12 allocs/op
BenchmarkDisabledAddingFields/rs/zerolog-16                   	32749550	        43.83 ns/op	      96 B/o       4 allocs/op
BenchmarkWithoutFields/Zap-16                                 	13454637	        88.45 ns/op	       0 B/o       0 allocs/op
BenchmarkWithoutFields/Zap.Check-16                           	14335971	        86.77 ns/op	       0 B/o       0 allocs/op
BenchmarkWithoutFields/Zap.CheckSampled-16                    	41160226	        31.19 ns/op	       0 B/o       0 allocs/op
BenchmarkWithoutFields/Zap.Sugar-16                           	 9391249	       130.1 ns/op	      16 B/o       1 allocs/op
BenchmarkWithoutFields/Zap.SugarFormatting-16                 	  433519	      2964 ns/op	    1921 B/o      58 allocs/op
BenchmarkWithoutFields/apex/log-16                            	  477319	      2215 ns/op	     336 B/o       6 allocs/op
BenchmarkWithoutFields/go-kit/kit/log-16                      	 4514253	       269.3 ns/op	     624 B/o      11 allocs/op
BenchmarkWithoutFields/inconshreveable/log15-16               	  287856	      4001 ns/op	    1531 B/o      22 allocs/op
BenchmarkWithoutFields/sirupsen/logrus-16                     	  333219	      3492 ns/op	    1189 B/o      24 allocs/op
BenchmarkWithoutFields/stdlib.Println-16                      	 2505471	       477.2 ns/op	      80 B/o       2 allocs/op
BenchmarkWithoutFields/stdlib.Printf-16                       	  576388	      2259 ns/op	    1916 B/o      58 allocs/op
BenchmarkWithoutFields/rs/zerolog-16                          	16719057	        70.86 ns/op	       0 B/o       0 allocs/op
BenchmarkWithoutFields/rs/zerolog.Formatting-16               	  533914	      2358 ns/op	    1915 B/o      58 allocs/op
BenchmarkWithoutFields/rs/zerolog.Check-16                    	17326017	        71.08 ns/op	       0 B/o       0 allocs/op
BenchmarkAccumulatedContext/Zap-16                            	11730692	       104.9 ns/op	       0 B/o       0 allocs/op
BenchmarkAccumulatedContext/Zap.Check-16                      	10466892	       110.3 ns/op	       0 B/o       0 allocs/op
BenchmarkAccumulatedContext/Zap.CheckSampled-16               	29829399	        35.28 ns/op	       0 B/o       0 allocs/op
BenchmarkAccumulatedContext/Zap.Sugar-16                      	 9005408	       153.1 ns/op	      16 B/o       1 allocs/op
BenchmarkAccumulatedContext/Zap.SugarFormatting-16            	  384753	      2847 ns/op	    1924 B/o      58 allocs/op
BenchmarkAccumulatedContext/apex/log-16                       	   40002	     27292 ns/op	    3398 B/o      55 allocs/op
BenchmarkAccumulatedContext/go-kit/kit/log-16                 	  285007	      3967 ns/op	    3782 B/o      58 allocs/op
BenchmarkAccumulatedContext/inconshreveable/log15-16          	   56227	     21094 ns/op	    3409 B/o      72 allocs/op
BenchmarkAccumulatedContext/sirupsen/logrus-16                	   40160	     30123 ns/op	    4170 B/o      68 allocs/op
BenchmarkAccumulatedContext/rs/zerolog-16                     	17182208	        71.26 ns/op	       0 B/o       0 allocs/op
BenchmarkAccumulatedContext/rs/zerolog.Check-16               	15840794	        76.62 ns/op	       0 B/o       0 allocs/op
BenchmarkAccumulatedContext/rs/zerolog.Formatting-16          	  484941	      2308 ns/op	    1914 B/o      58 allocs/op
BenchmarkAddingFields/Zap-16                                  	 1246309	      1102 ns/op	     739 B/o       5 allocs/op
BenchmarkAddingFields/Zap.Check-16                            	 1000000	      1100 ns/op	     739 B/o       5 allocs/op
BenchmarkAddingFields/Zap.CheckSampled-16                     	 7691926	       141.7 ns/op	      82 B/o       0 allocs/op
BenchmarkAddingFields/Zap.Sugar-16                            	  914066	      1386 ns/op	    1495 B/o      10 allocs/op
BenchmarkAddingFields/apex/log-16                             	   38598	     28518 ns/op	    4578 B/o      66 allocs/op
BenchmarkAddingFields/go-kit/kit/log-16                       	  331905	      3593 ns/op	    3410 B/o      59 allocs/op
BenchmarkAddingFields/inconshreveable/log15-16                	   40188	     30122 ns/op	    6766 B/o      76 allocs/op
BenchmarkAddingFields/sirupsen/logrus-16                      	   37783	     31557 ns/op	    5692 B/o      79 allocs/op
BenchmarkAddingFields/rs/zerolog-16                           	  428722	      2831 ns/op	    2572 B/o      32 allocs/op
BenchmarkAddingFields/rs/zerolog.Check-16                     	  419047	      2909 ns/op	    2571 B/o      32 allocs/op
PASS
ok  	go.uber.org/zap/benchmarks	74.046s
go: downloading google.golang.org/grpc v1.35.0
PASS
ok  	go.uber.org/zap/zapgrpc/internal/test	0.650s
zap $ 

Note the BenchmarkDisabledWithoutFields and BenchmarkAddingFields, they are all within benchmarks directory

But yeah, these pipelines are not running as part of PRs I guess. At least that's how it looks, because I can't see it running as part of this PR, but yeah the workflow mentions about PRs

https://github.com/uber-go/zap/blob/master/.github/workflows/go.yml#L3-L8

Not sure what has to be done to run as part of PRs https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request , maybe include types? I have seen that being done, but by default it should have just run it for all types then, not sure

@abhinav
Copy link
Collaborator

abhinav commented Sep 10, 2021

Hey @kishaningithub, thanks for the contribution.
We do not have continuous benchmarking yet, but at least for this change, to update the numbers in the README, you may run make updatereadme. (There's a possibility that readme.tmpl is outdated.)

@abhinav abhinav mentioned this pull request Nov 5, 2021
@abhinav
Copy link
Collaborator

abhinav commented Nov 5, 2021

Superseded by #1024

@abhinav abhinav closed this Nov 5, 2021
abhinav added a commit that referenced this pull request Nov 5, 2021
This change updates dependencies for all unpublished submodules of Zap
(benchmarks and zapgrpc/test).
Note that we do not update the minimum dependencies for Zap itself.
We don't need newer versions of any dependency than Zap currently uses.

We update the benchmark numbers in the README
by running `make updatereadme`.
That uses .readme.tmpl to generate the README,
but the template was not updated
when we changed the README in #752, #883, and #940.
So this change also updates the README template.

Supersedes #992
Ref GO-986
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants