Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/go tabled benchmarks #32

Merged
merged 8 commits into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function extractGoResult(output: string): BenchmarkResult[] {
// Example:
// BenchmarkFib20-8 30000 41653 ns/op
// BenchmarkDoWithConfigurer1-8 30000000 42.3 ns/op
const reExtract = /^(Benchmark\w+)(-\d+)?\s+(\d+)\s+([0-9.]+)\s+(.+)$/;
const reExtract = /^(Benchmark\w+(?:\/?[\w$%^&*-]*?)*?)(-\d+)?\s+(\d+)\s+([0-9.]+)\s+(.+)$/;
kaancfidan marked this conversation as resolved.
Show resolved Hide resolved

for (const line of lines) {
const m = line.match(reExtract);
Expand Down
7 changes: 5 additions & 2 deletions test/data/extract/go_output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
goos: darwin
goarch: amd64
BenchmarkFib10-8 5000000 325 ns/op
BenchmarkFib20 30000 40537.123 ns/op
BenchmarkFib10-8 5000000 325 ns/op
BenchmarkFib20 30000 40537.123 ns/op
BenchmarkFib/my_tabled_benchmark_-_10-8 5000000 325 ns/op
BenchmarkFib/my_tabled_benchmark_-_20 30000 40537.123 ns/op
kaancfidan marked this conversation as resolved.
Show resolved Hide resolved
BenchmarkFib/my/tabled/benchmark_-_20 30001 40537.456 ns/op
PASS
ok _/Users/rhayasd/Develop/github.com/rhysd/github-action-benchmark/examples/go 3.614s
18 changes: 18 additions & 0 deletions test/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@ describe('extractResult()', function() {
value: 40537.123,
extra: '30000 times',
},
{
name: 'BenchmarkFib/my_tabled_benchmark_-_10',
unit: 'ns/op',
value: 325,
extra: '5000000 times\n8 procs',
},
{
name: 'BenchmarkFib/my_tabled_benchmark_-_20',
unit: 'ns/op',
value: 40537.123,
extra: '30000 times',
},
{
name: 'BenchmarkFib/my/tabled/benchmark_-_20',
unit: 'ns/op',
value: 40537.456,
extra: '30001 times',
},
],
},
{
Expand Down