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

Method ReadSlice

bench/pop.go:100–119  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

98}
99
100func (pop *Pop) ReadSlice(b *testing.B) {
101 m := NewModel3()
102 for i := 0; i < 100; i++ {
103 err := pop.conn.Create(m)
104 if err != nil {
105 helper.SetError(b, pop.Name(), "ReadSlice", err.Error())
106 }
107 }
108
109 b.ReportAllocs()
110 b.ResetTimer()
111
112 for i := 0; i < b.N; i++ {
113 var ms []Model3
114 err := pop.conn.Where("id > 0").Limit(100).All(&ms)
115 if err != nil {
116 helper.SetError(b, pop.Name(), "ReadSlice", err.Error())
117 }
118 }
119}

Callers

nothing calls this directly

Calls 8

NameMethod · 0.95
SetErrorFunction · 0.92
NewModel3Function · 0.85
LimitMethod · 0.80
ErrorMethod · 0.65
CreateMethod · 0.45
AllMethod · 0.45
WhereMethod · 0.45

Tested by

no test coverage detected