From bd5cba0b0b548e8d872a916a9d8983ee17ae6548 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Fri, 15 Oct 2021 16:53:40 -0700 Subject: [PATCH] Update benchmarks readme (#630) * Fix ci.sh for new benchmarks Nice + taskset are more stable on my machine. We want to excude non high-level benchmarks. BurntSushi/toml now supports canada.toml. * Update latest benchmarks in README --- README.md | 33 +++++++++++++++++---------------- ci.sh | 6 ++---- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 4931d75..5089bb3 100644 --- a/README.md +++ b/README.md @@ -158,12 +158,12 @@ Execution time speedup compared to other Go TOML libraries: Benchmarkgo-toml v1BurntSushi/toml - Marshal/HugoFrontMatter2.0x2.0x - Marshal/ReferenceFile/map1.8x2.0x - Marshal/ReferenceFile/struct2.7x2.7x - Unmarshal/HugoFrontMatter3.0x2.6x - Unmarshal/ReferenceFile/map3.0x3.1x - Unmarshal/ReferenceFile/struct5.9x6.6x + Marshal/HugoFrontMatter-21.9x1.9x + Marshal/ReferenceFile/map-21.7x1.9x + Marshal/ReferenceFile/struct-22.4x2.6x + Unmarshal/HugoFrontMatter-22.9x2.5x + Unmarshal/ReferenceFile/map-22.7x2.6x + Unmarshal/ReferenceFile/struct-24.8x5.1x
See more @@ -176,16 +176,17 @@ provided for completeness.

Benchmarkgo-toml v1BurntSushi/toml - Marshal/SimpleDocument/map1.7x2.1x - Marshal/SimpleDocument/struct2.6x2.9x - Unmarshal/SimpleDocument/map4.1x2.9x - Unmarshal/SimpleDocument/struct6.3x4.1x - UnmarshalDataset/example3.5x2.4x - UnmarshalDataset/code2.2x2.8x - UnmarshalDataset/twitter2.8x2.1x - UnmarshalDataset/citm_catalog2.3x1.5x - UnmarshalDataset/config4.2x3.2x - [Geo mean]3.0x2.7x + Marshal/SimpleDocument/map-21.7x2.1x + Marshal/SimpleDocument/struct-22.5x2.8x + Unmarshal/SimpleDocument/map-24.1x3.1x + Unmarshal/SimpleDocument/struct-26.4x4.3x + UnmarshalDataset/example-23.4x3.2x + UnmarshalDataset/code-22.2x2.5x + UnmarshalDataset/twitter-22.8x2.7x + UnmarshalDataset/citm_catalog-22.2x2.0x + UnmarshalDataset/canada-21.8x1.4x + UnmarshalDataset/config-24.4x2.9x + [Geo mean]2.8x2.6x

This table can be generated with ./ci.sh benchmark -a -html.

diff --git a/ci.sh b/ci.sh index 3918f53..a617bc0 100755 --- a/ci.sh +++ b/ci.sh @@ -140,12 +140,10 @@ bench() { if [ "${replace}" != "" ]; then find ./benchmark/ -iname '*.go' -exec sed -i -E "s|github.com/pelletier/go-toml/v2|${replace}|g" {} \; go get "${replace}" - # hack: remove canada.toml.gz because it is not supported by - # burntsushi, and replace is only used for benchmark -a - rm -f benchmark/testdata/canada.toml.gz fi - go test -bench=. -count=10 ./... | tee "${out}" + export GOMAXPROCS=2 + nice -n -19 taskset --cpu-list 0,1 go test '-bench=^Benchmark(Un)?[mM]arshal' -count=5 -run=Nothing ./... | tee "${out}" popd if [ "${branch}" != "HEAD" ]; then