Created
March 20, 2020 12:16
-
-
Save TrinhTrungDung/c7170d9f42aafe0b48878a67982a270a to your computer and use it in GitHub Desktop.
Test benchmark for ORM create
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func BenchmarkOrmCreate(b *testing.B) { | |
db, err := gorm.Open("postgres", "host=localhost port=5432 user=testuser dbname=testdb password=123456 sslmode=disable") | |
if err != nil { | |
fmt.Println(err) | |
} | |
defer db.Close() | |
users := stubUsers(b) | |
for _, user := range users { | |
db.Create(user) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment