This benchmark provides a overview of the different SQLite driver performances available in Go.

Overview


SQLite/HTTP Server Performance Benchmark

This benchmark provides a overview of the different SQLite driver performances available in Go. For benchmarking a simple HTTP server is used to perform random read queries on the database.

For benchmarking the hey load generator is used to call the HTTP server (with 50 concurrent requests).

Driver Overview

Package Uses CGo Is driver for database/sql
crawshaw.io/sqlite Yes No
github.com/mattn/go-sqlite3 Yes Yes
modernc.org/sqlite No Yes
zombiezen.com/go/sqlite No No

Implementation

The implementation consists of a simple HTTP server that runs a single select query on the SQLite database for each request.

SELECT * FROM foo WHERE rowid = ? -- where ? is a random number between 1 and 10000

The SQLite database has the following schema and contains 100000 rows with random values.

CREATE TABLE foo (id integer, value integer);

See any of the subfolder/main.go files for more details.

Benchmark

The benchmark was run on a MacBook Pro 2020 with a 2.3 GHz Quad-Core Intel Core i7 and 32 GB of RAM.

The server is started with a configurable number of "connections" to the SQLite database, here called poolsize. Once the server is running hey is used to run the HTTP load test. See runbenchmark.go for details.

All reports of hey can be found in the result_*.txt files.

Result

package    poolsize   req/sec

crawshaw          1     24974
crawshaw          4     53092
crawshaw          8     51138
crawshaw         50     48494
crawshaw        100     39702

mattn             1     20807
mattn             4     50185
mattn             8     39778
mattn            50     28849
mattn           100     32546

modernc           1     19209
modernc           4     41386
modernc           8     39482
modernc          50     10169
modernc         100      7488

zombiezen         1     22829
zombiezen         4     55161
zombiezen         8     55505
zombiezen        50     59762
zombiezen       100     36622

Observations

  • The performance results between the packages do not differ that much.
  • Limiting the number of connections/poolsize to the SQLite database to roughly the number of CPU cores on the machine gives best performance results.
Owner
Philipp Tanlak
Author of PHP str_contains(...)
Philipp Tanlak
Continuous Benchmark for Go Project

Abstract cob compares benchmarks between the latest commit (HEAD) and the previous commit (HEAD{@1}). The program will fail if the change in score is

Teppei Fukuda 356 May 6, 2022
The test suite to demonstrate the chaos experiment behavior in different scenarios

Litmus-E2E The goal of litmus e2e is to provide the test suite to demonstrate the chaos experiment behavior in different scenarios. As the name sugges

Vedant Shrotria 0 Jan 4, 2022
Sql mock driver for golang to test database interactions

Sql driver mock for Golang sqlmock is a mock library implementing sql/driver. Which has one and only purpose - to simulate any sql driver behavior in

DATA-DOG 4.4k May 14, 2022
Immutable transaction isolated sql driver for golang

Single transaction based sql.Driver for GO Package txdb is a single transaction based database sql driver. When the connection is opened, it starts a

DATA-DOG 440 May 2, 2022
A Devtools driver for web automation and scraping

Overview Documentation | API reference Rod is a high-level driver directly based on DevTools Protocol. It's designed for web automation and scraping.

Rod 2.4k May 18, 2022
Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language.

cdp Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language. The bindings are generated

Mathias Fredriksson 603 May 11, 2022
A next-generation testing tool. Orion provides a powerful DSL to write and automate your acceptance tests

Orion is born to change the way we implement our acceptance tests. It takes advantage of HCL from Hashicorp t o provide a simple DSL to write the acceptance tests.

Wesovi Labs 40 Feb 25, 2022
🏳️ Go package that provides function like assert of Python or C++.

gassert gassert is Go package that provides function like assert of Python or C++. With gassert, you can check validation of parameters or values more

KyuSik Kim 4 May 20, 2021
testtime provides time.Now for testing.

testtime provides time.Now for testing.

Takuya Ueda 82 Mar 8, 2022
Snapshot - snapshot provides a set of utility functions for creating and loading snapshot files for using snapshot tests.

Snapshot - snapshot provides a set of utility functions for creating and loading snapshot files for using snapshot tests.

Daniel J. Rollins 2 Jan 27, 2022
Random - A Golang library that provides functions for generating random values

Random A Golang library that provides functions for generating random values. Us

Fatih Cetinkaya 1 Apr 14, 2022
Go-driver-benchmark - Driver benchmark with golang

We use ClickkHouse for time-series databases, and the driver's performance is ve

null 3 Jan 27, 2022
Redis-benchmark - Simple get, mget and pipelined get benchmark.

redis-benchmark Simple get, mget and pipelined get benchmark. Usage git clone https://github.com/Ali-A-A/redis-benchmark.git cd ./redis-benchmark dock

Ali Abbasi Alaei 0 Dec 31, 2021
Bxd redis benchmark - Redis benchmark tool for golang

使用 redis benchmark 工具, 测试 10 20 50 100 200 1k 5k 字节 value 大小,redis get set 性能。 r

bingxindan 0 Jan 22, 2022
Benchmark - Benchmark of logr implementations

Benchmark of logr implementations Implementations a function (can bridge to non-

null 2 Mar 23, 2022
Dbench - An unscientific benchmark of SQLite vs the file system (btrfs)

DBENCH Basic benchmarks for SQLite vs file system (btrfs on a 2020 Dell XPS SSD)

Chris Davies 37 Mar 5, 2022
Andrews-monitor - A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the pandemic when the dining hall was only available for online order.

Andrews Dining Hall Monitor A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the

null 0 Jan 1, 2022
Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client,

Devcloud-go Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client, you can use them w

HUAWEI CLOUD 10 Jan 4, 2022
This is a simple graph database in SQLite, inspired by "SQLite as a document database".

About This is a simple graph database in SQLite, inspired by "SQLite as a document database". Structure The schema consists of just two structures: No

Denis Papathanasiou 1k May 9, 2022
Package sqlite is a CGo-free port of SQLite.

sqlite Package sqlite is a CGo-free port of SQLite. SQLite is an in-process implementation of a self-contained, serverless, zero-configuration, transa

Joe 3 Nov 30, 2021
Go Cheat Sheet - An overview of Go syntax and features.

Go Cheat Sheet - An overview of Go syntax and features.

Ariel Mashraki 6.5k May 13, 2022
Aquatone is a tool for visual inspection of websites across a large amount of hosts and is convenient for quickly gaining an overview of HTTP-based attack surface.

Aquatone is a tool for visual inspection of websites across a large amount of hosts and is convenient for quickly gaining an overview of HTTP-based attack surface.

Michael Henriksen 4.6k May 15, 2022
Asynchronously control the different roles available in the kubernetes cluster

RBAC audit Introduction This tool allows you to asynchronously control the different roles available in the kubernetes cluster. These audits are enter

null 0 Oct 19, 2021
Golang database driver for SQLite

go-sqlite Golang database driver for SQLite. Does not use cgo. This driver is based on pure-Go SQLite implementation (https://gitlab.com/cznic/sqlite)

glebarez 26 May 7, 2022
CSPFinder is a tool to compare ROI of selling Cash Secure Put options between different tickers for different expiry dates.

CSPFinder is a tool to compare ROI of selling Cash Secure Put options between different tickers for different expiry dates. It is intended to help open new cash secured put positions.

Sreenidhi Sreesha 26 Dec 21, 2021
Plugs module to see different types of plug types needed in different countries, and a comparison tool between two countries plug socket types.

plugs Importing the module: go get github.com/matthewboyd/plugs "github.com/matthewboyd/plugs" How to use the module: There are two functions wi

Matthew Boyd 2 Dec 28, 2021
Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

Go-MySQL-Driver A MySQL-Driver for Go's database/sql package Features Requirements Installation Usage DSN (Data Source Name) Password Protocol Address

Go SQL Drivers 12.2k May 10, 2022
Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.

Qmgo English | 简体中文 Qmgo is a Go driver for MongoDB . It is based on MongoDB official driver, but easier to use like mgo (such as the chain call). Qmg

Qiniu Cloud 884 May 10, 2022