Skip to content

Add new benchmark for gola #13

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
31 changes: 30 additions & 1 deletion delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ package main
import (
"context"
"database/sql"
"github.com/gobuffalo/pop/v6"
"testing"

"github.com/gobuffalo/pop/v6"
"github.com/olachat/gola/coredb"

golas "github.com/volatiletech/boilbench/gola"
"github.com/volatiletech/boilbench/gorms"
"github.com/volatiletech/boilbench/gorps"
"github.com/volatiletech/boilbench/mimic"
Expand Down Expand Up @@ -41,6 +44,32 @@ func BenchmarkGORMDelete(b *testing.B) {
})
}

func BenchmarkGOLADelete(b *testing.B) {
pk := 1

exec := jetExec()
exec.NumInput = -1
mimic.NewResult(exec)

db, err := sql.Open("mimic", "")
if err != nil {
panic(err)
}

coredb.Setup(func(_ string, _ coredb.DBMode) *sql.DB {
return db
})

b.Run("gola", func(b *testing.B) {
for i := 0; i < b.N; i++ {
err := golas.DeleteByPK(pk)
if err != nil {
b.Fatal(err)
}
}
})
}

func BenchmarkGORPDelete(b *testing.B) {
store := gorps.Jet{
ID: 1,
Expand Down
72 changes: 70 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/volatiletech/boilbench

go 1.14
go 1.18

require (
github.com/friendsofgo/errors v0.9.2
github.com/gobuffalo/pop/v6 v6.0.1 // indirect
github.com/gobuffalo/pop/v6 v6.0.1
github.com/jmoiron/sqlx v1.3.4
github.com/olachat/gola v0.0.0-20220823103703-50fed997fe38
github.com/volatiletech/null/v8 v8.1.0
github.com/volatiletech/sqlboiler/v4 v4.2.0
github.com/volatiletech/strmangle v0.0.1
Expand All @@ -14,3 +15,70 @@ require (
gorm.io/gorm v1.20.2
xorm.io/xorm v1.0.5
)

require (
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/gobuffalo/envy v1.10.1 // indirect
github.com/gobuffalo/fizz v1.14.0 // indirect
github.com/gobuffalo/flect v0.2.4 // indirect
github.com/gobuffalo/github_flavored_markdown v1.1.1 // indirect
github.com/gobuffalo/helpers v0.6.4 // indirect
github.com/gobuffalo/nulls v0.4.1 // indirect
github.com/gobuffalo/plush/v4 v4.1.9 // indirect
github.com/gobuffalo/tags/v3 v3.1.2 // indirect
github.com/gobuffalo/validate/v3 v3.3.1 // indirect
github.com/gofrs/uuid v4.1.0+incompatible // indirect
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.10.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.1.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.8.1 // indirect
github.com/jackc/pgx/v4 v4.13.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.1 // indirect
github.com/joho/godotenv v1.4.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/lib/pq v1.10.4 // indirect
github.com/luna-duclos/instrumentedsql v1.1.3 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-sqlite3 v1.14.9 // indirect
github.com/microcosm-cc/bluemonday v1.0.16 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d // indirect
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.2.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.8.1 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/volatiletech/inflect v0.0.1 // indirect
github.com/volatiletech/randomize v0.0.1 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
xorm.io/builder v0.3.7 // indirect
)
Loading