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

Method Read

bench/pg.go:97–114  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

95}
96
97func (pg *Pg) Read(b *testing.B) {
98 m := NewModel()
99
100 _, err := pg.conn.Model(m).Insert()
101 if err != nil {
102 helper.SetError(b, pg.Name(), "Read", err.Error())
103 }
104
105 b.ReportAllocs()
106 b.ResetTimer()
107
108 for i := 0; i < b.N; i++ {
109 err := pg.conn.Model(m).Limit(1).Select()
110 if err != nil {
111 helper.SetError(b, pg.Name(), "Read", err.Error())
112 }
113 }
114}
115
116func (pg *Pg) ReadSlice(b *testing.B) {
117 m := NewModel()

Callers

nothing calls this directly

Calls 7

NameMethod · 0.95
SetErrorFunction · 0.92
NewModelFunction · 0.85
LimitMethod · 0.80
InsertMethod · 0.65
ErrorMethod · 0.65
SelectMethod · 0.45

Tested by

no test coverage detected