From 17b218e8c91327fcd574363d8bc5725b64b5871d Mon Sep 17 00:00:00 2001 From: Tevin Zhang Date: Thu, 16 Jul 2020 13:50:42 +0800 Subject: [PATCH] Update benchmark to Go 1.14.3 on Linux Assuming that Linux is a more popular platform than Darwin when running this package --- README.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3376bfd..c03178a 100644 --- a/README.md +++ b/README.md @@ -30,27 +30,31 @@ type Foo struct { ## Benchmark -- Go 1.11.5 -- OS X 10.14.5 +- Go 1.14.3 +- Linux 4.19.0 + +```bash +goos: linux +goarch: amd64 -```shell # Read -BenchmarkMutexRead-4 100000000 14.7 ns/op -BenchmarkAtomicValueRead-4 2000000000 0.45 ns/op -BenchmarkAtomicBoolRead-4 2000000000 0.35 ns/op # <--- This package +BenchmarkMutexRead-4 86662128 14.2 ns/op +BenchmarkAtomicValueRead-4 1000000000 0.755 ns/op +BenchmarkAtomicBoolRead-4 1000000000 0.720 ns/op # <--- This package + # Write -BenchmarkMutexWrite-4 100000000 14.5 ns/op -BenchmarkAtomicValueWrite-4 100000000 10.5 ns/op -BenchmarkAtomicBoolWrite-4 300000000 5.21 ns/op # <--- This package +BenchmarkMutexWrite-4 76237544 13.6 ns/op +BenchmarkAtomicValueWrite-4 79471124 14.9 ns/op +BenchmarkAtomicBoolWrite-4 178218270 6.73 ns/op # <--- This package # CAS -BenchmarkMutexCAS-4 50000000 31.3 ns/op -BenchmarkAtomicBoolCAS-4 200000000 7.18 ns/op # <--- This package +BenchmarkMutexCAS-4 29416574 34.7 ns/op +BenchmarkAtomicBoolCAS-4 171900002 7.14 ns/op # <--- This package # Toggle -BenchmarkMutexToggle-4 50000000 32.6 ns/op -BenchmarkAtomicBoolToggle-4 300000000 5.21 ns/op # <--- This package +BenchmarkMutexToggle-4 35212117 34.5 ns/op +BenchmarkAtomicBoolToggle-4 169871972 7.02 ns/op # <--- This package ``` ## Special thanks to contributors