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

Method Update

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

Source from the content-addressed store, hash-verified

88}
89
90func (rel *Rel) Update(b *testing.B) {
91 m := NewModel3()
92 m.ID = 0
93 err := rel.conn.Insert(ctx, m)
94 if err != nil {
95 helper.SetError(b, rel.Name(), "Update", err.Error())
96 }
97
98 b.ReportAllocs()
99 b.ResetTimer()
100
101 for i := 0; i < b.N; i++ {
102 err := rel.conn.Update(ctx, m)
103 if err != nil {
104 helper.SetError(b, rel.Name(), "Update", err.Error())
105 }
106 }
107}
108
109func (rel *Rel) Read(b *testing.B) {
110 m := NewModel3()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected