good morning!!!!

Skip to content
Snippets Groups Projects
Commit aa1f426e authored by José Carlos Nieto's avatar José Carlos Nieto
Browse files

Merge branch 'benchmark' of https://github.com/larsmans/db into larsmans-benchmark

parents 3671d85d f6f99612
No related branches found
No related tags found
No related merge requests found
...@@ -1380,8 +1380,13 @@ func BenchmarkAppendRawSQL(b *testing.B) { ...@@ -1380,8 +1380,13 @@ func BenchmarkAppendRawSQL(b *testing.B) {
} }
b.ResetTimer() b.ResetTimer()
stmt, err := driver.Prepare(
`INSERT INTO "artist" ("name") VALUES('Hayao Miyazaki')`)
if err != nil {
b.Fatal(err)
}
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
if _, err = driver.Exec(`INSERT INTO "artist" ("name") VALUES('Hayao Miyazaki')`); err != nil { if _, err = stmt.Exec(); err != nil {
b.Fatal(err) b.Fatal(err)
} }
} }
...@@ -1438,8 +1443,13 @@ func BenchmarkAppendTxRawSQL(b *testing.B) { ...@@ -1438,8 +1443,13 @@ func BenchmarkAppendTxRawSQL(b *testing.B) {
} }
b.ResetTimer() b.ResetTimer()
stmt, err := tx.Prepare(
`INSERT INTO "artist" ("name") VALUES('Hayao Miyazaki')`)
if err != nil {
b.Fatal(err)
}
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
if _, err = tx.Exec(`INSERT INTO "artist" ("name") VALUES('Hayao Miyazaki')`); err != nil { if _, err = stmt.Exec(); err != nil {
b.Fatal(err) b.Fatal(err)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment