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

Method InsertMulti

bench/xorm.go:52–67  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

50}
51
52func (xorm *Xorm) InsertMulti(b *testing.B) {
53 ms := make([]*Model5, 0, 100)
54 for i := 0; i < 100; i++ {
55 ms = append(ms, NewModel5())
56 }
57
58 b.ReportAllocs()
59 b.ResetTimer()
60
61 for i := 0; i < b.N; i++ {
62 _, err := xorm.conn.Insert(&ms)
63 if err != nil {
64 helper.SetError(b, xorm.Name(), "InsertMulti", err.Error())
65 }
66 }
67}
68
69func (xorm *Xorm) Update(b *testing.B) {
70 m := NewModel5()

Callers

nothing calls this directly

Calls 5

NameMethod · 0.95
SetErrorFunction · 0.92
NewModel5Function · 0.85
InsertMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected