MCPcopy
hub / github.com/go-sql-driver/mysql / BenchmarkExecContext

Function BenchmarkExecContext

benchmark_test.go:318–331  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

316}
317
318func BenchmarkExecContext(b *testing.B) {
319 db := initDB(b, false,
320 "DROP TABLE IF EXISTS foo",
321 "CREATE TABLE foo (id INT PRIMARY KEY, val CHAR(50))",
322 `INSERT INTO foo VALUES (1, "one")`,
323 `INSERT INTO foo VALUES (2, "two")`,
324 )
325 defer db.Close()
326 for _, p := range []int{1, 2, 3, 4} {
327 b.Run(fmt.Sprintf("%d", p), func(b *testing.B) {
328 benchmarkExecContext(b, db, p)
329 })
330 }
331}
332
333// BenchmarkQueryRawBytes benchmarks fetching 100 blobs using sql.RawBytes.
334// "size=" means size of each blobs.

Callers

nothing calls this directly

Calls 3

initDBFunction · 0.85
benchmarkExecContextFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected