MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / setupBenchmarkLargeWriteTx

Function setupBenchmarkLargeWriteTx

xenomint/sqlite/sqlite_test.go:664–681  ·  view source on GitHub ↗
(
	b *testing.B, st xi.Storage, e string, src [][]interface{}, n int)

Source from the content-addressed store, hash-verified

662}
663
664func setupBenchmarkLargeWriteTx(
665 b *testing.B, st xi.Storage, e string, src [][]interface{}, n int) (tx *sql.Tx,
666) {
667 var err error
668 ipkg.reset()
669 if tx, err = st.Writer().Begin(); err != nil {
670 b.Fatalf("Failed to setup bench environment: %v", err)
671 }
672 for i := 0; i < n; i++ {
673 if _, err = tx.Exec(e, src[ipkg.next()]...); err != nil {
674 b.Fatalf("Failed to setup bench environment: %v", err)
675 }
676 }
677 if _, err = tx.Exec(`SAVEPOINT "xmark"`); err != nil {
678 b.Fatalf("Failed to setup bench environment: %v", err)
679 }
680 return
681}
682
683func resetBenchmarkLargeWriteTx(b *testing.B, tx *sql.Tx) {
684 var err error

Callers 1

BenchmarkLargeWriteTxFunction · 0.85

Calls 6

FatalfMethod · 0.80
resetMethod · 0.65
WriterMethod · 0.65
ExecMethod · 0.65
nextMethod · 0.65
BeginMethod · 0.45

Tested by

no test coverage detected