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

Method InsertMulti

bench/reform.go:59–74  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

57}
58
59func (reform *Reform) InsertMulti(b *testing.B) {
60 ms := make([]reformware.Struct, 0, 100)
61 for i := 0; i < 100; i++ {
62 ms = append(ms, NewReformModel())
63 }
64
65 b.ReportAllocs()
66 b.ResetTimer()
67
68 for i := 0; i < b.N; i++ {
69 err := reform.conn.InsertMulti(ms...)
70 if err != nil {
71 helper.SetError(b, reform.Name(), "InsertMulti", err.Error())
72 }
73 }
74}
75
76func (reform *Reform) Update(b *testing.B) {
77 m := NewReformModel()

Callers

nothing calls this directly

Calls 5

NameMethod · 0.95
SetErrorFunction · 0.92
NewReformModelFunction · 0.85
InsertMultiMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected