From df605fba1516f688c6a848931d687eabaf2c57b4 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 6 Dec 2024 20:12:08 +0000 Subject: [PATCH] fix benchmark for daysix package --- day-06/benchmark | 16 +++++++++++++++- day-06/solve.go | 2 +- day-06/solve_internal_test.go | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 day-06/solve_internal_test.go diff --git a/day-06/benchmark b/day-06/benchmark index 1c69ef6..a111cc0 100644 --- a/day-06/benchmark +++ b/day-06/benchmark @@ -1 +1,15 @@ -? github.com/onyx-and-iris/aoc2024/day-06 [no test files] +goos: linux +goarch: amd64 +pkg: github.com/onyx-and-iris/aoc2024/day-06 +cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz +BenchmarkSolve-12 1 1815042506 ns/op +BenchmarkSolve-12 1 1670139306 ns/op +BenchmarkSolve-12 1 1708459605 ns/op +BenchmarkSolve-12 1 1687274507 ns/op +BenchmarkSolve-12 1 1722070212 ns/op +BenchmarkSolve-12 1 1728997012 ns/op +BenchmarkSolve-12 1 1738883012 ns/op +BenchmarkSolve-12 1 1686811712 ns/op +BenchmarkSolve-12 1 1701938016 ns/op +BenchmarkSolve-12 1 1701384522 ns/op +ok github.com/onyx-and-iris/aoc2024/day-06 17.190s diff --git a/day-06/solve.go b/day-06/solve.go index c570c79..0a0d896 100644 --- a/day-06/solve.go +++ b/day-06/solve.go @@ -1,4 +1,4 @@ -package name +package daysix import ( "github.com/onyx-and-iris/aoc2024/day-06/internal/one" diff --git a/day-06/solve_internal_test.go b/day-06/solve_internal_test.go new file mode 100644 index 0000000..0682d54 --- /dev/null +++ b/day-06/solve_internal_test.go @@ -0,0 +1,15 @@ +package daysix + +import ( + _ "embed" + "os" + "testing" +) + +//go:embed testdata/input.txt +var data []byte + +func BenchmarkSolve(b *testing.B) { + os.Stdout, _ = os.Open(os.DevNull) + Solve(data) +}