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

Function BenchmarkSQLite

cmd/cql-minerd/integration_test.go:886–915  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

884}
885
886func BenchmarkSQLite(b *testing.B) {
887 var db *sql.DB
888 var createDB bool
889 millionFile := fmt.Sprintf("/data/sqlite_bigdata/insert_multi_sqlitedb0_1_%v", ROWSTART)
890 f, err := os.Open(millionFile)
891 if err != nil && os.IsNotExist(err) {
892 os.Remove("./foo.db")
893 defer os.Remove("./foo.db")
894
895 db, err = sql.Open("sqlite3", "./foo.db?_journal_mode=WAL&_synchronous=NORMAL&cache=shared")
896 if err != nil {
897 log.Fatal(err)
898 }
899 createDB = true
900 defer db.Close()
901 } else {
902 f.Close()
903 db, err = sql.Open("sqlite3", millionFile+"?_journal_mode=WAL&_synchronous=NORMAL&cache=shared")
904 log.Infof("testing sqlite3 million data exist file %v", millionFile)
905 if err != nil {
906 log.Fatal(err)
907 }
908 createDB = false
909 defer db.Close()
910 }
911
912 Convey("bench SQLite", b, func() {
913 benchDB(b, db, createDB)
914 })
915}
916
917func benchOutsideMiner(b *testing.B, minerCount uint16, confDir string) {
918 benchOutsideMinerWithTargetMinerList(b, minerCount, nil, confDir)

Callers

nothing calls this directly

Calls 6

FatalFunction · 0.92
InfofFunction · 0.92
benchDBFunction · 0.85
CloseMethod · 0.65
OpenMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected