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

Method Update

bench/upper.go:87–104  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

85}
86
87func (upper *Upper) Update(b *testing.B) {
88 m := NewModel4()
89
90 err := upper.conn.Collection("models").InsertReturning(m)
91 if err != nil {
92 helper.SetError(b, upper.Name(), "Update", err.Error())
93 }
94
95 b.ReportAllocs()
96 b.ResetTimer()
97
98 for i := 0; i < b.N; i++ {
99 err := upper.conn.Collection("models").UpdateReturning(m)
100 if err != nil {
101 helper.SetError(b, upper.Name(), "Update", err.Error())
102 }
103 }
104}
105
106func (upper *Upper) Read(b *testing.B) {
107 m := NewModel4()

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected