Skip to content

Commit

Permalink
chore: Update benchmark (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraeger authored May 15, 2024
1 parent 4cf42a2 commit 768e345
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions benchmark/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/sumup/typeid"
jpTypeId "go.jetpack.io/typeid"
jpTypeId "go.jetify.com/typeid"
)

func BenchmarkNew(b *testing.B) {
Expand All @@ -26,7 +26,7 @@ func BenchmarkNew(b *testing.B) {
})
})

b.Run("jetpack-io/typeid", func(b *testing.B) {
b.Run("go.jetify.com/typeid", func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
//nolint:errcheck // Benchmark.
Expand All @@ -51,7 +51,7 @@ func BenchmarkString(b *testing.B) {
})
})

b.Run("jetpack-io/typeid", func(b *testing.B) {
b.Run("go.jetify.com/typeid", func(b *testing.B) {
b.Run(benchStringJp(1))
b.Run(benchStringJp(8))
b.Run(benchStringJp(64))
Expand All @@ -75,7 +75,7 @@ func BenchmarkFromString(b *testing.B) {
})
})

b.Run("jetpack-io/typeid", func(b *testing.B) {
b.Run("go.jetify.com/typeid", func(b *testing.B) {
b.Run(benchFromStringJetpack(1))
b.Run(benchFromStringJetpack(8))
b.Run(benchFromStringJetpack(64))
Expand Down Expand Up @@ -223,7 +223,7 @@ func BenchmarkEncodeDecode(b *testing.B) {
})
})

b.Run("jetpack-io/typeid", func(b *testing.B) {
b.Run("go.jetify.com/typeid", func(b *testing.B) {
for i := 0; i < b.N; i++ {
tid := jpTypeId.Must(jpTypeId.New[JetpackID]())
_ = jpTypeId.Must(jpTypeId.Parse[JetpackID](tid.String()))
Expand Down
5 changes: 3 additions & 2 deletions benchmark/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
)

require (
github.com/gofrs/uuid/v5 v5.0.0 // indirect
github.com/jackc/pgx/v5 v5.5.3 // indirect
github.com/gofrs/uuid/v5 v5.2.0 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
go.jetify.com/typeid v1.1.0 // indirect
)
10 changes: 6 additions & 4 deletions benchmark/go.sum
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM=
github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.5.3 h1:Ces6/M3wbDXYpM8JyyPD57ivTtJACFZJd885pdIaV2s=
github.com/jackc/pgx/v5 v5.5.3/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
go.jetify.com/typeid v1.1.0 h1:eRW/BBYx1Kh3DiOKBLaAHbwomxK4jm4/tWuNshN5wXY=
go.jetify.com/typeid v1.1.0/go.mod h1:68KXnMPJvJi4Pf2vUhr1QtWo5LfXzMwbUdLfwPlO4jI=
go.jetpack.io/typeid v1.0.0 h1:8gQ+iYGdyiQ0Pr40ydSB/PzMOIwlXX5DTojp1CBeSPQ=
go.jetpack.io/typeid v1.0.0/go.mod h1:+UPEaECUgFxgAjFPn5Yf9eO/3ft/3xZ98Eahv9JW/GQ=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
Expand Down

0 comments on commit 768e345

Please sign in to comment.