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

Method Insert

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

Source from the content-addressed store, hash-verified

43}
44
45func (reform *Reform) Insert(b *testing.B) {
46 m := NewReformModel()
47
48 b.ReportAllocs()
49 b.ResetTimer()
50
51 for i := 0; i < b.N; i++ {
52 err := reform.conn.Save(m)
53 if err != nil {
54 helper.SetError(b, reform.Name(), "Insert", err.Error())
55 }
56 }
57}
58
59func (reform *Reform) InsertMulti(b *testing.B) {
60 ms := make([]reformware.Struct, 0, 100)

Callers

nothing calls this directly

Calls 5

NameMethod · 0.95
SetErrorFunction · 0.92
NewReformModelFunction · 0.85
ErrorMethod · 0.65
SaveMethod · 0.45

Tested by

no test coverage detected