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

Method InsertMulti

bench/rel.go:70–88  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

68}
69
70func (rel *Rel) InsertMulti(b *testing.B) {
71 ms := make([]*Model3, 0, 100)
72 for i := 0; i < 100; i++ {
73 ms = append(ms, NewModel3())
74 }
75
76 b.ReportAllocs()
77 b.ResetTimer()
78
79 for i := 0; i < b.N; i++ {
80 for _, m := range ms {
81 m.ID = 0
82 }
83 err := rel.conn.InsertAll(ctx, &ms)
84 if err != nil {
85 helper.SetError(b, rel.Name(), "InsertMulti", err.Error())
86 }
87 }
88}
89
90func (rel *Rel) Update(b *testing.B) {
91 m := NewModel3()

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected