diff --git a/README.md b/README.md index 63b92f3b..b10f97f0 100644 --- a/README.md +++ b/README.md @@ -179,12 +179,12 @@ Execution time speedup compared to other Go TOML libraries: Benchmarkgo-toml v1BurntSushi/toml - Marshal/HugoFrontMatter-21.9x1.9x - Marshal/ReferenceFile/map-21.7x1.8x - Marshal/ReferenceFile/struct-22.2x2.5x - Unmarshal/HugoFrontMatter-22.9x2.9x - Unmarshal/ReferenceFile/map-22.6x2.9x - Unmarshal/ReferenceFile/struct-24.4x5.3x + Marshal/HugoFrontMatter-21.9x2.2x + Marshal/ReferenceFile/map-21.7x2.1x + Marshal/ReferenceFile/struct-22.2x3.0x + Unmarshal/HugoFrontMatter-22.9x2.7x + Unmarshal/ReferenceFile/map-22.6x2.7x + Unmarshal/ReferenceFile/struct-24.6x5.1x
See more @@ -197,17 +197,17 @@ provided for completeness.

Benchmarkgo-toml v1BurntSushi/toml - Marshal/SimpleDocument/map-21.8x2.9x - Marshal/SimpleDocument/struct-22.7x4.2x - Unmarshal/SimpleDocument/map-24.5x3.1x - Unmarshal/SimpleDocument/struct-26.2x3.9x - UnmarshalDataset/example-23.1x3.5x - UnmarshalDataset/code-22.3x3.1x - UnmarshalDataset/twitter-22.5x2.6x - UnmarshalDataset/citm_catalog-22.1x2.2x - UnmarshalDataset/canada-21.6x1.3x - UnmarshalDataset/config-24.3x3.2x - [Geo mean]2.7x2.8x + Marshal/SimpleDocument/map-21.8x2.7x + Marshal/SimpleDocument/struct-22.7x3.8x + Unmarshal/SimpleDocument/map-23.8x3.0x + Unmarshal/SimpleDocument/struct-25.6x4.1x + UnmarshalDataset/example-23.0x3.2x + UnmarshalDataset/code-22.3x2.9x + UnmarshalDataset/twitter-22.6x2.7x + UnmarshalDataset/citm_catalog-22.2x2.3x + UnmarshalDataset/canada-21.8x1.5x + UnmarshalDataset/config-24.1x2.9x + geomean2.7x2.8x

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

diff --git a/ci.sh b/ci.sh index 9ae8b753..712298e2 100755 --- a/ci.sh +++ b/ci.sh @@ -152,7 +152,7 @@ bench() { fi export GOMAXPROCS=2 - nice -n -19 taskset --cpu-list 0,1 go test '-bench=^Benchmark(Un)?[mM]arshal' -count=5 -run=Nothing ./... | tee "${out}" + go test '-bench=^Benchmark(Un)?[mM]arshal' -count=10 -run=Nothing ./... | tee "${out}" popd if [ "${branch}" != "HEAD" ]; then @@ -161,10 +161,12 @@ bench() { } fmktemp() { - if mktemp --version|grep GNU >/dev/null; then - mktemp --suffix=-$1; + if mktemp --version &> /dev/null; then + # GNU + mktemp --suffix=-$1 else - mktemp -t $1; + # BSD + mktemp -t $1 fi } @@ -184,12 +186,14 @@ with open(sys.argv[1]) as f: lines.append(line.split(',')) results = [] -for line in reversed(lines[1:]): +for line in reversed(lines[2:]): + if len(line) < 8 or line[0] == "": + continue v2 = float(line[1]) results.append([ line[0].replace("-32", ""), "%.1fx" % (float(line[3])/v2), # v1 - "%.1fx" % (float(line[5])/v2), # bs + "%.1fx" % (float(line[7])/v2), # bs ]) # move geomean to the end results.append(results[0]) @@ -260,10 +264,10 @@ benchmark() { if [ "$1" = "-html" ]; then tmpcsv=`fmktemp csv` - benchstat -csv -geomean go-toml-v2.txt go-toml-v1.txt bs-toml.txt > $tmpcsv + benchstat -format csv go-toml-v2.txt go-toml-v1.txt bs-toml.txt > $tmpcsv benchstathtml $tmpcsv else - benchstat -geomean go-toml-v2.txt go-toml-v1.txt bs-toml.txt + benchstat go-toml-v2.txt go-toml-v1.txt bs-toml.txt fi rm -f go-toml-v2.txt go-toml-v1.txt bs-toml.txt