MCPcopy Create free account
hub / github.com/efectn/go-orm-benchmarks / InsertMulti

Method InsertMulti

bench/sqlx.go:62–77  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

60}
61
62func (sqlx *Sqlx) InsertMulti(b *testing.B) {
63 ms := make([]*Model, 0, 100)
64 for i := 0; i < 100; i++ {
65 ms = append(ms, NewModel())
66 }
67
68 b.ReportAllocs()
69 b.ResetTimer()
70
71 for i := 0; i < b.N; i++ {
72 _, err := sqlx.conn.NamedExec(sqlxInsertMultiSQL, ms)
73 if err != nil {
74 helper.SetError(b, sqlx.Name(), "InsertMulti", err.Error())
75 }
76 }
77}
78
79func (sqlx *Sqlx) Update(b *testing.B) {
80 m := NewModel()

Callers

nothing calls this directly

Calls 4

NameMethod · 0.95
SetErrorFunction · 0.92
NewModelFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected