diff --git a/README.md b/README.md index 8cc9542..f5f173e 100644 --- a/README.md +++ b/README.md @@ -239,12 +239,12 @@ Execution time speedup compared to other Go TOML libraries: Benchmarkgo-toml v1BurntSushi/toml - 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 + Marshal/HugoFrontMatter-22.1x2.0x + Marshal/ReferenceFile/map-21.9x2.0x + Marshal/ReferenceFile/struct-22.3x2.5x + Unmarshal/HugoFrontMatter-23.4x2.8x + Unmarshal/ReferenceFile/map-23.0x3.0x + Unmarshal/ReferenceFile/struct-24.9x5.1x
See more @@ -257,17 +257,17 @@ provided for completeness.

Benchmarkgo-toml v1BurntSushi/toml - 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 + Marshal/SimpleDocument/map-22.0x2.9x + Marshal/SimpleDocument/struct-22.5x3.5x + Unmarshal/SimpleDocument/map-24.3x3.5x + Unmarshal/SimpleDocument/struct-25.9x4.5x + UnmarshalDataset/example-23.2x2.9x + UnmarshalDataset/code-22.4x2.9x + UnmarshalDataset/twitter-22.7x2.5x + UnmarshalDataset/citm_catalog-22.1x2.1x + UnmarshalDataset/canada-21.9x1.5x + UnmarshalDataset/config-25.4x3.1x + geomean2.9x2.8x

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

diff --git a/ci.sh b/ci.sh index 86217a9..30c23d1 100755 --- a/ci.sh +++ b/ci.sh @@ -147,7 +147,7 @@ bench() { pushd "$dir" if [ "${replace}" != "" ]; then - find ./benchmark/ -iname '*.go' -exec sed -i -E "s|github.com/pelletier/go-toml/v2|${replace}|g" {} \; + find ./benchmark/ -iname '*.go' -exec sed -i -E "s|github.com/pelletier/go-toml/v2\"|${replace}\"|g" {} \; go get "${replace}" fi @@ -195,6 +195,11 @@ for line in reversed(lines[2:]): "%.1fx" % (float(line[3])/v2), # v1 "%.1fx" % (float(line[7])/v2), # bs ]) + +if not results: + print("No benchmark results to display.", file=sys.stderr) + sys.exit(1) + # move geomean to the end results.append(results[0]) del results[0]