Skip to content

Commit

Permalink
update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
amirrezaask committed Nov 28, 2021
1 parent d2d53ab commit cda5eda
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ test:
bench:
cd examples/benchmarks/ && sqlite3 boiler.db "CREATE TABLE IF NOT EXISTS records (id integer primary key, name text)"
cd examples/benchmarks/ && sqlboiler sqlite3
cd examples/benchmarks/ && go run *.go && rm -rf *db && rm -rf *journal
cd examples/benchmarks/ && go run *.go
Binary file added examples/benchmarks/boiler.db-journal
Binary file not shown.
3 changes: 1 addition & 2 deletions examples/benchmarks/golobby.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ func golobby() {
if err != nil {
panic(err)
}
repo := orm.NewSchema(dbGolobby, orm.Dialects.SQLite3, &Record{})
start := time.Now()
// golobby
func() {
repo := orm.NewSchema(dbGolobby, orm.Dialects.SQLite3, &Record{})

for i := 0; i < 10000; i++ {
m := &Record{
Name: "comrade-" + fmt.Sprint(i),
Expand Down
10 changes: 9 additions & 1 deletion examples/benchmarks/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package main

import "fmt"
import (
"fmt"
"os"
)

func main() {
fmt.Println("Benchmarking Golang ORMs ...")
defer func() {
os.Remove("golobby.db")
os.Remove("gorm.db")
os.Remove("boiler.db")
}()
golobby()
boiler()
_gorm()
Expand Down

0 comments on commit cda5eda

Please sign in to comment.