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

Method Read

bench/gorp.go:79–96  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

77}
78
79func (gorp *Gorp) Read(b *testing.B) {
80 m := NewModel()
81
82 err := gorp.conn.Insert(m)
83 if err != nil {
84 helper.SetError(b, gorp.Name(), "Read", err.Error())
85 }
86
87 b.ReportAllocs()
88 b.ResetTimer()
89
90 for i := 0; i < b.N; i++ {
91 err := gorp.conn.SelectOne(m, "SELECT * FROM models LIMIT 1")
92 if err != nil {
93 helper.SetError(b, gorp.Name(), "Read", err.Error())
94 }
95 }
96}
97
98func (gorp *Gorp) ReadSlice(b *testing.B) {
99 m := NewModel()

Callers

nothing calls this directly

Calls 5

NameMethod · 0.95
SetErrorFunction · 0.92
NewModelFunction · 0.85
InsertMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected