add benchmarks for one and two

This commit is contained in:
2024-12-02 02:06:26 +00:00
parent d05828154e
commit 84312b157c
8 changed files with 72 additions and 42 deletions

View File

@@ -0,0 +1,6 @@
goos: linux
goarch: amd64
pkg: github.com/onyx-and-iris/aoc2024/day-01/internal/one
cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
BenchmarkMain-12 1000000000 0.0006628 ns/op
ok github.com/onyx-and-iris/aoc2024/day-01/internal/one 0.009s

View File

@@ -0,0 +1,15 @@
package one
import (
_ "embed"
"os"
"testing"
)
//go:embed testdata/input.txt
var data []byte
func BenchmarkMain(b *testing.B) {
os.Stdout, _ = os.Open(os.DevNull)
Solve(data)
}

View File

@@ -0,0 +1,6 @@
goos: linux
goarch: amd64
pkg: github.com/onyx-and-iris/aoc2024/day-01/internal/two
cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
BenchmarkMain-12 1000000000 0.001179 ns/op
ok github.com/onyx-and-iris/aoc2024/day-01/internal/two 0.011s

View File

@@ -0,0 +1,15 @@
package two
import (
_ "embed"
"os"
"testing"
)
//go:embed testdata/input.txt
var data []byte
func BenchmarkMain(b *testing.B) {
os.Stdout, _ = os.Open(os.DevNull)
Solve(data)
}