diff --git a/bench_test.go b/bench_test.go index 75c2017..59c26bf 100644 --- a/bench_test.go +++ b/bench_test.go @@ -110,10 +110,10 @@ func BenchmarkAll(b *testing.B) { for _, testname := range benchnames { argdata, err := os.ReadFile(testname + "/args.txt") casesJoined := strings.TrimSpace(string(argdata)) - if len(argdata) == 0 { - b.Fatalf("%s has empty 'args.txt' file", testname) - } else if err != nil { - b.Fatalf("%s failed open arguments file 'args.txt': %s", testname, err) + if err != nil { + b.Fatalf("benchmark %q: failed open arguments file 'args.txt': %s", testname, err) + } else if len(argdata) == 0 { + b.Fatalf("benchmark %q: has empty 'args.txt' file", testname) } cases := strings.Split(casesJoined, "\n") diff --git a/fannkuch-redux/args.txt b/fannkuch-redux/args.txt index a268daa..74d79f9 100644 --- a/fannkuch-redux/args.txt +++ b/fannkuch-redux/args.txt @@ -1,3 +1,2 @@ -6 -7 -9 \ No newline at end of file +9 +10 \ No newline at end of file diff --git a/fasta/args.txt b/fasta/args.txt index e726c4b..c4637df 100644 --- a/fasta/args.txt +++ b/fasta/args.txt @@ -1,2 +1,2 @@ -12500000 -25000000 \ No newline at end of file +1000000 +8000000 \ No newline at end of file diff --git a/n-body-nosqrt/args.txt b/n-body-nosqrt/args.txt index 0690e70..5c8e75b 100644 --- a/n-body-nosqrt/args.txt +++ b/n-body-nosqrt/args.txt @@ -1,3 +1,2 @@ -50000 -100000 -200000 \ No newline at end of file +200000 +300000 \ No newline at end of file diff --git a/n-body/args.txt b/n-body/args.txt index 0690e70..5c8e75b 100644 --- a/n-body/args.txt +++ b/n-body/args.txt @@ -1,3 +1,2 @@ -50000 -100000 -200000 \ No newline at end of file +200000 +300000 \ No newline at end of file diff --git a/plot_/main.go b/plot_/main.go index 790afae..cdb2ed9 100644 --- a/plot_/main.go +++ b/plot_/main.go @@ -55,7 +55,7 @@ func drawBenchmark(langs []langBench, savefile, baseCompiler string) error { var ( maxBenchs = nBenchs * len(langs) plotHeight = 10 * vg.Inch - plotWidth = plotHeight * vg.Length(maxBenchs) / 20 + plotWidth = plotHeight*vg.Length(maxBenchs)/20 + 1*vg.Centimeter benchWidth = plotWidth / vg.Length(nBenchs) fontsize = plotHeight / 25 @@ -117,6 +117,7 @@ func drawBenchmark(langs []langBench, savefile, baseCompiler string) error { } p_time.Legend.Top = true p_time.NominalX(nominals...) + p_time.X.Max *= 1.1 // Give bars margin so they don't overlap with legend. p_time.X.Tick.Label.Font.Size = benchWidth / 12 // Nominal size. p_time.Title.TextStyle.Font.Size = fontsize diff --git a/results/tinygo-0.39.0.png b/results_/tinygo-0.39.0.png similarity index 100% rename from results/tinygo-0.39.0.png rename to results_/tinygo-0.39.0.png diff --git a/results/tinygo-0.40.0.png b/results_/tinygo-0.40.0.png similarity index 100% rename from results/tinygo-0.40.0.png rename to results_/tinygo-0.40.0.png diff --git a/results_/tinygo-0.42.0.png b/results_/tinygo-0.42.0.png new file mode 100644 index 0000000..5f1b94e Binary files /dev/null and b/results_/tinygo-0.42.0.png differ diff --git a/results_/tinygo-0.42.0.txt b/results_/tinygo-0.42.0.txt new file mode 100644 index 0000000..5189dfe --- /dev/null +++ b/results_/tinygo-0.42.0.txt @@ -0,0 +1,176 @@ +goos: linux +goarch: amd64 +pkg: tinybench +cpu: 12th Gen Intel(R) Core(TM) i5-12400F +BenchmarkAll + bench_test.go:107: found compiler zig 0.15.2 + bench_test.go:107: found compiler rustc 1.95.0 + bench_test.go:107: found compiler go 1.25.7 + bench_test.go:107: found compiler tinygo 0.42.0 + bench_test.go:107: found compiler gcc 15.2.1 + bench_test.go:107: found compiler clang 20.1.1 + bench_test.go:109: looking for benchmarks in [fannkuch-redux fasta n-body n-body-nosqrt spectral-norm] +BenchmarkAll/fannkuch-redux:args=9/zig/zig + bench_test.go:145: name="fannkuch-redux" compiler="zig" binarysize=2346112 version=0.15.2 +BenchmarkAll/fannkuch-redux:args=9/zig/zig-12 84 13338193 ns/op +BenchmarkAll/fannkuch-redux:args=10/zig/zig +BenchmarkAll/fannkuch-redux:args=10/zig/zig-12 8 138295479 ns/op +BenchmarkAll/fannkuch-redux:args=9/rust/rustc + bench_test.go:145: name="fannkuch-redux" compiler="rustc" binarysize=4347344 version=1.95.0 +BenchmarkAll/fannkuch-redux:args=9/rust/rustc-12 76 15641016 ns/op +BenchmarkAll/fannkuch-redux:args=10/rust/rustc +BenchmarkAll/fannkuch-redux:args=10/rust/rustc-12 7 165121882 ns/op +BenchmarkAll/fannkuch-redux:args=9/go/go + bench_test.go:145: name="fannkuch-redux" compiler="go" binarysize=2344532 version=1.25.7 +BenchmarkAll/fannkuch-redux:args=9/go/go-12 69 16479844 ns/op +BenchmarkAll/fannkuch-redux:args=10/go/go +BenchmarkAll/fannkuch-redux:args=10/go/go-12 7 162629276 ns/op +BenchmarkAll/fannkuch-redux:args=9/go/tinygo + bench_test.go:145: name="fannkuch-redux" compiler="tinygo" binarysize=1541496 version=0.42.0 +BenchmarkAll/fannkuch-redux:args=9/go/tinygo-12 86 13419369 ns/op +BenchmarkAll/fannkuch-redux:args=10/go/tinygo +BenchmarkAll/fannkuch-redux:args=10/go/tinygo-12 8 141694903 ns/op +BenchmarkAll/fannkuch-redux:args=9/c/gcc + bench_test.go:145: name="fannkuch-redux" compiler="gcc" binarysize=16328 version=15.2.1 +BenchmarkAll/fannkuch-redux:args=9/c/gcc-12 70 15476821 ns/op +BenchmarkAll/fannkuch-redux:args=10/c/gcc +BenchmarkAll/fannkuch-redux:args=10/c/gcc-12 7 160211098 ns/op +BenchmarkAll/fannkuch-redux:args=9/c/clang + bench_test.go:145: name="fannkuch-redux" compiler="clang" binarysize=16280 version=20.1.1 +BenchmarkAll/fannkuch-redux:args=9/c/clang-12 69 15687532 ns/op +BenchmarkAll/fannkuch-redux:args=10/c/clang +BenchmarkAll/fannkuch-redux:args=10/c/clang-12 7 160899619 ns/op +BenchmarkAll/fasta:args=1000000/zig/zig + bench_test.go:145: name="fasta" compiler="zig" binarysize=2348224 version=0.15.2 +BenchmarkAll/fasta:args=1000000/zig/zig-12 10 115100689 ns/op +BenchmarkAll/fasta:args=8000000/zig/zig +BenchmarkAll/fasta:args=8000000/zig/zig-12 2 949552186 ns/op +BenchmarkAll/fasta:args=1000000/rust/rustc + bench_test.go:145: name="fasta" compiler="rustc" binarysize=4348144 version=1.95.0 +BenchmarkAll/fasta:args=1000000/rust/rustc-12 10 110101344 ns/op +BenchmarkAll/fasta:args=8000000/rust/rustc +BenchmarkAll/fasta:args=8000000/rust/rustc-12 2 816579526 ns/op +BenchmarkAll/fasta:args=1000000/go/go + bench_test.go:145: name="fasta" compiler="go" binarysize=2457030 version=1.25.7 +BenchmarkAll/fasta:args=1000000/go/go-12 10 107901207 ns/op +BenchmarkAll/fasta:args=8000000/go/go +BenchmarkAll/fasta:args=8000000/go/go-12 2 842708221 ns/op +BenchmarkAll/fasta:args=1000000/go/tinygo + bench_test.go:145: name="fasta" compiler="tinygo" binarysize=1679592 version=0.42.0 +BenchmarkAll/fasta:args=1000000/go/tinygo-12 10 100115916 ns/op +BenchmarkAll/fasta:args=8000000/go/tinygo +BenchmarkAll/fasta:args=8000000/go/tinygo-12 2 780127678 ns/op +BenchmarkAll/fasta:args=1000000/c/gcc + bench_test.go:145: name="fasta" compiler="gcc" binarysize=16280 version=15.2.1 +BenchmarkAll/fasta:args=1000000/c/gcc-12 12 96286704 ns/op +BenchmarkAll/fasta:args=8000000/c/gcc +BenchmarkAll/fasta:args=8000000/c/gcc-12 2 804399738 ns/op +BenchmarkAll/fasta:args=1000000/c/clang + bench_test.go:145: name="fasta" compiler="clang" binarysize=16200 version=20.1.1 +BenchmarkAll/fasta:args=1000000/c/clang-12 12 99917398 ns/op +BenchmarkAll/fasta:args=8000000/c/clang +BenchmarkAll/fasta:args=8000000/c/clang-12 2 728786948 ns/op +BenchmarkAll/n-body:args=200000/zig/zig + bench_test.go:145: name="n-body" compiler="zig" binarysize=2389576 version=0.15.2 +BenchmarkAll/n-body:args=200000/zig/zig-12 172 7789949 ns/op +BenchmarkAll/n-body:args=300000/zig/zig +BenchmarkAll/n-body:args=300000/zig/zig-12 120 10300733 ns/op +BenchmarkAll/n-body:args=200000/rust/rustc + bench_test.go:145: name="n-body" compiler="rustc" binarysize=4373424 version=1.95.0 +BenchmarkAll/n-body:args=200000/rust/rustc-12 120 9743532 ns/op +BenchmarkAll/n-body:args=300000/rust/rustc +BenchmarkAll/n-body:args=300000/rust/rustc-12 86 13575028 ns/op +BenchmarkAll/n-body:args=200000/go/go + bench_test.go:145: name="n-body" compiler="go" binarysize=2344462 version=1.25.7 +BenchmarkAll/n-body:args=200000/go/go-12 81 14521758 ns/op +BenchmarkAll/n-body:args=300000/go/go +BenchmarkAll/n-body:args=300000/go/go-12 57 20612938 ns/op +BenchmarkAll/n-body:args=200000/go/tinygo + bench_test.go:145: name="n-body" compiler="tinygo" binarysize=1554032 version=0.42.0 +BenchmarkAll/n-body:args=200000/go/tinygo-12 120 10082239 ns/op +BenchmarkAll/n-body:args=300000/go/tinygo +BenchmarkAll/n-body:args=300000/go/tinygo-12 84 14288535 ns/op +BenchmarkAll/n-body:args=200000/c/gcc + bench_test.go:145: name="n-body" compiler="gcc" binarysize=16400 version=15.2.1 +BenchmarkAll/n-body:args=200000/c/gcc-12 136 8271588 ns/op +BenchmarkAll/n-body:args=300000/c/gcc +BenchmarkAll/n-body:args=300000/c/gcc-12 98 11860719 ns/op +BenchmarkAll/n-body:args=200000/c/clang + bench_test.go:145: name="n-body" compiler="clang" binarysize=16384 version=20.1.1 +BenchmarkAll/n-body:args=200000/c/clang-12 136 8943665 ns/op +BenchmarkAll/n-body:args=300000/c/clang +BenchmarkAll/n-body:args=300000/c/clang-12 87 12151455 ns/op +BenchmarkAll/n-body-nosqrt:args=200000/zig/zig + bench_test.go:145: name="n-body-nosqrt" compiler="zig" binarysize=2394784 version=0.15.2 +BenchmarkAll/n-body-nosqrt:args=200000/zig/zig-12 25 45025962 ns/op +BenchmarkAll/n-body-nosqrt:args=300000/zig/zig +BenchmarkAll/n-body-nosqrt:args=300000/zig/zig-12 16 64477314 ns/op +BenchmarkAll/n-body-nosqrt:args=200000/rust/rustc + bench_test.go:145: name="n-body-nosqrt" compiler="rustc" binarysize=4373760 version=1.95.0 +BenchmarkAll/n-body-nosqrt:args=200000/rust/rustc-12 24 49967861 ns/op +BenchmarkAll/n-body-nosqrt:args=300000/rust/rustc +BenchmarkAll/n-body-nosqrt:args=300000/rust/rustc-12 15 73972680 ns/op +BenchmarkAll/n-body-nosqrt:args=200000/go/go + bench_test.go:145: name="n-body-nosqrt" compiler="go" binarysize=2344394 version=1.25.7 +BenchmarkAll/n-body-nosqrt:args=200000/go/go-12 19 56375283 ns/op +BenchmarkAll/n-body-nosqrt:args=300000/go/go +BenchmarkAll/n-body-nosqrt:args=300000/go/go-12 13 84115020 ns/op +BenchmarkAll/n-body-nosqrt:args=200000/go/tinygo + bench_test.go:145: name="n-body-nosqrt" compiler="tinygo" binarysize=1555056 version=0.42.0 +BenchmarkAll/n-body-nosqrt:args=200000/go/tinygo-12 24 47262108 ns/op +BenchmarkAll/n-body-nosqrt:args=300000/go/tinygo +BenchmarkAll/n-body-nosqrt:args=300000/go/tinygo-12 15 69850927 ns/op +BenchmarkAll/n-body-nosqrt:args=200000/c/gcc + bench_test.go:145: name="n-body-nosqrt" compiler="gcc" binarysize=16480 version=15.2.1 +BenchmarkAll/n-body-nosqrt:args=200000/c/gcc-12 21 48628458 ns/op +BenchmarkAll/n-body-nosqrt:args=300000/c/gcc +BenchmarkAll/n-body-nosqrt:args=300000/c/gcc-12 15 72387650 ns/op +BenchmarkAll/n-body-nosqrt:args=200000/c/clang + bench_test.go:145: name="n-body-nosqrt" compiler="clang" binarysize=16472 version=20.1.1 +BenchmarkAll/n-body-nosqrt:args=200000/c/clang-12 24 45343357 ns/op +BenchmarkAll/n-body-nosqrt:args=300000/c/clang +BenchmarkAll/n-body-nosqrt:args=300000/c/clang-12 16 66182942 ns/op +BenchmarkAll/spectral-norm:args=1000/zig/zig + bench_test.go:145: name="spectral-norm" compiler="zig" binarysize=2395664 version=0.15.2 +BenchmarkAll/spectral-norm:args=1000/zig/zig-12 26 45412660 ns/op +BenchmarkAll/spectral-norm:args=2500/zig/zig +BenchmarkAll/spectral-norm:args=2500/zig/zig-12 4 269827153 ns/op +BenchmarkAll/spectral-norm:args=5500/zig/zig +BenchmarkAll/spectral-norm:args=5500/zig/zig-12 1 1294434348 ns/op +BenchmarkAll/spectral-norm:args=1000/rust/rustc + bench_test.go:145: name="spectral-norm" compiler="rustc" binarysize=4369232 version=1.95.0 +BenchmarkAll/spectral-norm:args=1000/rust/rustc-12 26 40112268 ns/op +BenchmarkAll/spectral-norm:args=2500/rust/rustc +BenchmarkAll/spectral-norm:args=2500/rust/rustc-12 5 237616028 ns/op +BenchmarkAll/spectral-norm:args=5500/rust/rustc +BenchmarkAll/spectral-norm:args=5500/rust/rustc-12 1 1146370868 ns/op +BenchmarkAll/spectral-norm:args=1000/go/go + bench_test.go:145: name="spectral-norm" compiler="go" binarysize=2445722 version=1.25.7 +BenchmarkAll/spectral-norm:args=1000/go/go-12 28 40958338 ns/op +BenchmarkAll/spectral-norm:args=2500/go/go +BenchmarkAll/spectral-norm:args=2500/go/go-12 4 254545702 ns/op +BenchmarkAll/spectral-norm:args=5500/go/go +BenchmarkAll/spectral-norm:args=5500/go/go-12 1 1133576823 ns/op +BenchmarkAll/spectral-norm:args=1000/go/tinygo + bench_test.go:145: name="spectral-norm" compiler="tinygo" binarysize=1656672 version=0.42.0 +BenchmarkAll/spectral-norm:args=1000/go/tinygo-12 28 39752987 ns/op +BenchmarkAll/spectral-norm:args=2500/go/tinygo +BenchmarkAll/spectral-norm:args=2500/go/tinygo-12 5 235496935 ns/op +BenchmarkAll/spectral-norm:args=5500/go/tinygo +BenchmarkAll/spectral-norm:args=5500/go/tinygo-12 1 1128457952 ns/op +BenchmarkAll/spectral-norm:args=1000/c/gcc + bench_test.go:145: name="spectral-norm" compiler="gcc" binarysize=16168 version=15.2.1 +BenchmarkAll/spectral-norm:args=1000/c/gcc-12 38 28843310 ns/op +BenchmarkAll/spectral-norm:args=2500/c/gcc +BenchmarkAll/spectral-norm:args=2500/c/gcc-12 6 170103765 ns/op +BenchmarkAll/spectral-norm:args=5500/c/gcc +BenchmarkAll/spectral-norm:args=5500/c/gcc-12 2 827869374 ns/op +BenchmarkAll/spectral-norm:args=1000/c/clang + bench_test.go:145: name="spectral-norm" compiler="clang" binarysize=16144 version=20.1.1 +BenchmarkAll/spectral-norm:args=1000/c/clang-12 28 39267236 ns/op +BenchmarkAll/spectral-norm:args=2500/c/clang +BenchmarkAll/spectral-norm:args=2500/c/clang-12 5 255589071 ns/op +BenchmarkAll/spectral-norm:args=5500/c/clang +BenchmarkAll/spectral-norm:args=5500/c/clang-12 1 1226402364 ns/op +PASS +ok tinybench 146.996s