You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

modernc.org/sqlite-bench

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modernc.org/sqlite-bench

v1.1.4
Go
Version published
Created
Source

logo-png

Go Reference

The SQLite Drivers 25.06 Benchmarks Game

This repository is a modification of go-sqlite-bench, forked at 4df8bfd.

Category: database/sql drivers

For the non database/sql drivers category please see modernc.org/sqlite-bench2

[[TOC]]

Drivers

These drivers are benchmarked

Go version: go1.24.3

A general note on benchmarks and this repository

Do not trust benchmarks, write your own. These specific benchmarks are modelled after someone's very own database usage scenarios. Your scenarios may be totally different.

Each test is run twice, the recorded values are the averages of the two runs. This is not very scientific.

Database Schema

The test database consist of the following tables and indices:

PRAGMA journal_mode=DELETE;
PRAGMA synchronous=FULL;
PRAGMA foreign_keys=1;
PRAGMA busy_timeout=5000;

CREATE TABLE users (
    id INTEGER PRIMARY KEY NOT NULL,
    created INTEGER NOT NULL,
    email TEXT NOT NULL,
    active INTEGER NOT NULL);
CREATE INDEX users_created ON users(created);

CREATE TABLE articles (
    id INTEGER PRIMARY KEY NOT NULL,
    created INTEGER NOT NULL,  
    userId INTEGER NOT NULL REFERENCES users(id),
    text TEXT NOT NULL);
CREATE INDEX articles_created ON articles(created);
CREATE INDEX articles_userId ON articles(userId);

CREATE TABLE comments (
    id INTEGER PRIMARY KEY NOT NULL,
    created INTEGER NOT NULL,
    articleId INTEGER NOT NULL REFERENCES articles(id),
    text TEXT NOT NULL);
CREATE INDEX comments_created ON comments(created);
CREATE INDEX comments_articleId ON comments(articleId);

Benchmark Results

Result times are measured in milliseconds. Lower numbers indicate better performance.

Simple Benchmark

Insert 1 million user rows in one database transaction. Then query all users once.

Complex Benchmark

Insert 200 users in one database transaction. Then insert 20000 articles (100 articles for each user) in another transaction. Then insert 400000 comments (20 comments for each article) in another transaction. Then query all users, articles and comments in one big JOIN statement.

Many Benchmark

Insert N users in one database transaction. Then query all users 1000 times. This benchmark is used to simluate a read-heavy use case.

Large Benchmark

Insert 10000 users with N bytes of row content. Then query all users. This benchmark is used to simluate reading of large (gigabytes) databases.

Concurrent Benchmark

Insert one million users. Then have N goroutines query all users. This benchmark is used to simulate concurrent reads.

4GB RAM builders

On 32 bit architectures and on the linux/ppc64le builder - to avoid OOM

  • the Large benchmark uses 2.5k users instead of a 10k.
  • the Concurrent benchmark uses 250k users instead of a million.

Caveat emptor

Mistakes happen. If you find anything wrong about the results please report the problem at the issue tracker, thank you.

tl;dr: Scorecard

The best time in every test, shown in bold in the tables below individual graphs, is worth one point. The scorecard shows where and how many points were awarded to each benchmarked package.

Total score ties are ranked alphabetically. Please read those as one shared rank.

This score is an ad hoc aggregate metric. Its usefulness is possibly at most in showing how the scores may evolve in time when new, improved versions of packages will get benchmarked.

The time results for the particular OS and HW provide a more detailed info.

TotalSimpleComplexManyLargeConcurrent
1. modernc122161443247
2. mattn6616165290
3. ncruces20020171

Disclaimer: The score and the ranking do not show how will any package perform in your particular application on a particular system. Additionally, empirically the scores fluctuate as much as about +/- 10 points. It's complicatd to better stabilize the results to be more precise and reliable. On some machines the tests run for many hours already with n = 2.

Results: darwin/amd64

  • OS: macOS Sequoia 15.3.2
  • CPU: Apple M1, 2020
  • GOMAXPROCS: 8
  • RAM: 8GB
  • Disk: APPLE SSD AP0256Q Media (251GB)

darwin/amd64-simple-png

Simpleinsertquery
mattn*78914431
modernc28568*2244
ncruces206253057

Lower numbers are better. * Scorecard point awarded.

darwin/amd64-complex-png

Complexinsertquery
mattn*46816314
modernc14961*3619
ncruces112024362

Lower numbers are better. * Scorecard point awarded.

darwin/amd64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn1245003930
modernc*98*268*1927
ncruces1473902618

Lower numbers are better. * Scorecard point awarded.

darwin/amd64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn65515734851
modernc112317006084
ncruces*653*1209*4044

Lower numbers are better. * Scorecard point awarded.

darwin/amd64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn472449489975
modernc*3058*3149*5897
ncruces359439397618

Lower numbers are better. * Scorecard point awarded.

Results: darwin/arm64

  • OS: macOS Sequoia 15.3.2
  • CPU: Apple M1, 2020
  • GOMAXPROCS: 8
  • RAM: 8GB
  • Disk: APPLE SSD AP0256Q Media (251GB)

darwin/arm64-simple-png

Simpleinsertquery
mattn*1209783
modernc3817*550
ncruces2097578

Lower numbers are better. * Scorecard point awarded.

darwin/arm64-complex-png

Complexinsertquery
mattn*6771004
modernc2150865
ncruces1300*861

Lower numbers are better. * Scorecard point awarded.

darwin/arm64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn1882737
modernc*17*60*515
ncruces2671537

Lower numbers are better. * Scorecard point awarded.

darwin/arm64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn3067302976
modernc2454143228
ncruces*146*268*1706

Lower numbers are better. * Scorecard point awarded.

darwin/arm64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn93210191964
modernc*645*7521559
ncruces666760*1279

Lower numbers are better. * Scorecard point awarded.

Results: freebsd/amd64

  • OS: FreeBSD 14.2-RELEASE (GENERIC) releng/14.2-n269506-c8918d6c7412
  • CPU: qemu-system-x86_64 version 7.2.15 hosted on linux/amd64-0
  • GOMAXPROCS: 2
  • RAM: 8GB
  • Disk: qemu qcow2 (64GB)

freebsd/amd64-simple-png

Simpleinsertquery
mattn*26221739
modernc7128*1310
ncruces46751613

Lower numbers are better. * Scorecard point awarded.

freebsd/amd64-complex-png

Complexinsertquery
mattn*15672064
modernc3857*1630
ncruces30251995

Lower numbers are better. * Scorecard point awarded.

freebsd/amd64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn*291831674
modernc39*114*1045
ncruces512052084

Lower numbers are better. * Scorecard point awarded.

freebsd/amd64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*2778183748
modernc68812744450
ncruces337*672*1287

Lower numbers are better. * Scorecard point awarded.

freebsd/amd64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn195639827622
modernc*1322*2585*5079
ncruces173335236951

Lower numbers are better. * Scorecard point awarded.

Results: freebsd/arm64

  • OS: FreeBSD 14.2-RELEASE (GENERIC) releng/14.2-n269506-c8918d6c7412
  • CPU: qemu-system-aarch64 version 7.2.15 hosted on linux/amd64-0
  • GOMAXPROCS: 2
  • RAM: 8GB
  • Disk: qemu qcow2 (64GB)

freebsd/arm64-simple-png

Simpleinsertquery
mattn*3940429174
modernc137826*14007
ncruces6028018400

Lower numbers are better. * Scorecard point awarded.

freebsd/arm64-complex-png

Complexinsertquery
mattn*2110839047
modernc75486*20364
ncruces3722621151

Lower numbers are better. * Scorecard point awarded.

freebsd/arm64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn724363125420
modernc*513*1555*12701
ncruces529204617130

Lower numbers are better. * Scorecard point awarded.

freebsd/arm64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*5855907719539
modernc109681473629899
ncruces5938*7981*17546

Lower numbers are better. * Scorecard point awarded.

freebsd/arm64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn3641070713133161
modernc*16998*32698*65793
ncruces173283955083330

Lower numbers are better. * Scorecard point awarded.

Results: linux/386

  • OS: Devuan GNU/Linux 5 (daedalus)
  • CPU: qemu-system-i386 version 7.2.15 hosted on linux/amd64-0
  • GOMAXPROCS: 2
  • RAM: 4GB
  • Disk: qemu qcow2 (64GB)

linux/386-simple-png

Simpleinsertquery
mattn*29582379
modernc8509*1701
ncruces15652021787

Lower numbers are better. * Scorecard point awarded.

linux/386-complex-png

Complexinsertquery
mattn*16282755
modernc4644*2268
ncruces10692847603

Lower numbers are better. * Scorecard point awarded.

linux/386-many-png

Manyquery/N=10query/N=100query/N=1000
mattn402392230
modernc*37*169*1524
ncruces805275822240

Lower numbers are better. * Scorecard point awarded.

linux/386-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*59*130*202
modernc168257512
ncruces244435608

Lower numbers are better. * Scorecard point awarded.

linux/386-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn64513492779
modernc*511*988*2021
ncruces55951130422276

Lower numbers are better. * Scorecard point awarded.

Results: linux/amd64

  • OS: Devuan GNU/Linux 5 (daedalus)
  • CPU: Intel(R) Celeron(R) J4005 CPU @ 2.00GHz
  • GOMAXPROCS: 2
  • RAM: 8GB
  • Disk: SanDisk SDSSDHII, 447GiB (480GB)

linux/amd64-simple-png

Simpleinsertquery
mattn*84504142
modernc23970*3077
ncruces141604092

Lower numbers are better. * Scorecard point awarded.

linux/amd64-complex-png

Complexinsertquery
mattn*43474939
modernc132755100
ncruces8187*4609

Lower numbers are better. * Scorecard point awarded.

linux/amd64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn*160*510*4948
modernc2296225010
ncruces2388665114

Lower numbers are better. * Scorecard point awarded.

linux/amd64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*700*124717798
modernc182430665747
ncruces11212130*3752

Lower numbers are better. * Scorecard point awarded.

linux/amd64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn4729870417515
modernc*3146*6985*14006
ncruces4659978919257

Lower numbers are better. * Scorecard point awarded.

Results: linux/amd64-0

  • OS: Devuan GNU/Linux 5 (daedalus)
  • CPU: AMD Ryzen 9 3900X 12-Core Processor
  • GOMAXPROCS: 24
  • RAM: 128GB
  • Disk: NVMe, 476GiB (512GB)

linux/amd64-0-simple-png

Simpleinsertquery
mattn*25141730
modernc7387*1124
ncruces43941622

Lower numbers are better. * Scorecard point awarded.

linux/amd64-0-complex-png

Complexinsertquery
mattn*13952104
modernc4249*1725
ncruces26432053

Lower numbers are better. * Scorecard point awarded.

linux/amd64-0-many-png

Manyquery/N=10query/N=100query/N=1000
mattn321782556
modernc*29*108*1692
ncruces521732662

Lower numbers are better. * Scorecard point awarded.

linux/amd64-0-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*296*409*942
modernc87315682343
ncruces3125111011

Lower numbers are better. * Scorecard point awarded.

linux/amd64-0-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn199020912233
modernc*1231*1428*1605
ncruces170818231917

Lower numbers are better. * Scorecard point awarded.

Results: linux/arm

  • OS: Raspbian GNU/Linux 12 (bookworm)
  • CPU: Cortex-A72 (Raspberry Pi 4 Model B Rev 1.2)
  • GOMAXPROCS: 4
  • RAM: 4GB
  • Disk: SanDisk SD Card SR256, 238GiB (255GB)

linux/arm-simple-png

Simpleinsertquery
mattn*2018715741
modernc58909*12982
ncruces1094710164053

Lower numbers are better. * Scorecard point awarded.

linux/arm-complex-png

Complexinsertquery
mattn*1021816378
modernc30537*14640
ncruces751774345544

Lower numbers are better. * Scorecard point awarded.

linux/arm-many-png

Manyquery/N=10query/N=100query/N=1000
mattn237153415106
modernc*231*1268*12339
ncruces560720132167370

Lower numbers are better. * Scorecard point awarded.

linux/arm-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*285*426*648
modernc67310462235
ncruces167122173785

Lower numbers are better. * Scorecard point awarded.

linux/arm-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn4494510910056
modernc*3728*4205*8200
ncruces417764289587398

Lower numbers are better. * Scorecard point awarded.

Results: linux/arm64

  • OS: Raspbian GNU/Linux 12 (bookworm)
  • CPU: Cortex-A76 (Raspberry Pi 5 Model B Rev 1.0)
  • GOMAXPROCS: 4
  • RAM: 8GB
  • Disk: NVMe, 238GiB (256GB)

linux/arm64-simple-png

Simpleinsertquery
mattn*37092642
modernc12237*1912
ncruces81482018

Lower numbers are better. * Scorecard point awarded.

linux/arm64-complex-png

Complexinsertquery
mattn*19343120
modernc6634*2589
ncruces45722672

Lower numbers are better. * Scorecard point awarded.

linux/arm64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn442452389
modernc*42*179*1727
ncruces742351923

Lower numbers are better. * Scorecard point awarded.

linux/arm64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*219*4202554
modernc5649461711
ncruces297520*971

Lower numbers are better. * Scorecard point awarded.

linux/arm64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn286832846498
modernc*2143*2572*5158
ncruces227428725985

Lower numbers are better. * Scorecard point awarded.

Results: linux/loong64

  • OS: Fedora release 38 (Rawhide)
  • CPU: loongarch64
  • GOMAXPROCS: 4
  • RAM: 16GB
  • Disk: NVMe, (157GB)

linux/loong64-simple-png

Simpleinsertquery
mattn*57984625
modernc20071*3272
ncruces36179347983

Lower numbers are better. * Scorecard point awarded.

linux/loong64-complex-png

Complexinsertquery
mattn*28665273
modernc10608*4234
ncruces237559100398

Lower numbers are better. * Scorecard point awarded.

linux/loong64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn854564195
modernc*82*340*2827
ncruces1720591748492

Lower numbers are better. * Scorecard point awarded.

linux/loong64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*297*545*939
modernc85713552166
ncruces195526904160

Lower numbers are better. * Scorecard point awarded.

linux/loong64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn4844562811401
modernc*3654*4209*8391
ncruces483844901298137

Lower numbers are better. * Scorecard point awarded.

Results: linux/ppc64le

  • OS: Debian GNU/Linux 11 (bullseye)
  • CPU: qemu hosted on POWER8
  • GOMAXPROCS: 2
  • RAM: 4GB
  • Disk: qemu unknown, 40GiB (42GB)

linux/ppc64le-simple-png

Simpleinsertquery
mattn*71375410
modernc20973*4508
ncruces36309254340

Lower numbers are better. * Scorecard point awarded.

linux/ppc64le-complex-png

Complexinsertquery
mattn*38236097
modernc11540*5680
ncruces246499116868

Lower numbers are better. * Scorecard point awarded.

linux/ppc64le-many-png

Manyquery/N=10query/N=100query/N=1000
mattn845385177
modernc*82*456*4308
ncruces1720648454842

Lower numbers are better. * Scorecard point awarded.

linux/ppc64le-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*88*147*285
modernc161274534
ncruces4807261171

Lower numbers are better. * Scorecard point awarded.

linux/ppc64le-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn171734356887
modernc*1255*2697*5334
ncruces138872778355737

Lower numbers are better. * Scorecard point awarded.

Results: linux/riscv64

  • OS: Debian GNU/Linux trixie/sid
  • CPU: riscv64, sifive,bullet0
  • GOMAXPROCS: 4
  • RAM: 16GB
  • Disk: NVMe 917GB

linux/riscv64-simple-png

Simpleinsertquery
mattn*3538426821
modernc123109*19825
ncruces2411735357051

Lower numbers are better. * Scorecard point awarded.

linux/riscv64-complex-png

Complexinsertquery
mattn*2091830419
modernc71231*23014
ncruces1618813764016

Lower numbers are better. * Scorecard point awarded.

linux/riscv64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn465261625485
modernc*431*1892*17365
ncruces1160941905374722

Lower numbers are better. * Scorecard point awarded.

linux/riscv64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*5201*9005*17502
modernc124272331146925
ncruces168052905550607

Lower numbers are better. * Scorecard point awarded.

linux/riscv64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn303053712475232
modernc*24408*29295*56255
ncruces376824380630743924

Lower numbers are better. * Scorecard point awarded.

Results: linux/s390x

  • OS: Devuan GNU/Linux 5 (daedalus)
  • CPU: qemu-system-s390x version 7.2.15 hosted on linux/amd64-0
  • GOMAXPROCS: 2
  • RAM: 24GB
  • Disk: qemu qcow2 (64GB)

linux/s390x-simple-png

Simpleinsertquery
mattn*4821633186
modernc161101*21763
ncruces1816362284892

Lower numbers are better. * Scorecard point awarded.

linux/s390x-complex-png

Complexinsertquery
mattn*2627035152
modernc89195*26467
ncruces1216654589756

Lower numbers are better. * Scorecard point awarded.

linux/s390x-many-png

Manyquery/N=10query/N=100query/N=1000
mattn770339129258
modernc*675*2289*17638
ncruces910232869272683

Lower numbers are better. * Scorecard point awarded.

linux/s390x-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*7870*15708*24232
modernc180542754060216
ncruces185633039964134

Lower numbers are better. * Scorecard point awarded.

linux/s390x-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn4553488767178996
modernc*23734*46592*90265
ncruces2952505826041155901

Lower numbers are better. * Scorecard point awarded.

Results: windows/386

  • OS: Windows 10 Pro 22H2
  • CPU: qemu-system-x86_64 version 7.2.15 hosted on linux/amd64-0
  • GOMAXPROCS: 2
  • RAM: 4GB
  • Disk: qemu qcow2 (64GB)

windows/386-simple-png

Simpleinsertquery
mattn*34642862
modernc13122*2050
ncruces25954734022

Lower numbers are better. * Scorecard point awarded.

windows/386-complex-png

Complexinsertquery
mattn*23303873
modernc7014*3453
ncruces17472276433

Lower numbers are better. * Scorecard point awarded.

windows/386-many-png

Manyquery/N=10query/N=100query/N=1000
mattn*713353083
modernc89*318*2333
ncruces1153466837405

Lower numbers are better. * Scorecard point awarded.

windows/386-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn*173643621951
modernc273*49624265
ncruces509686*20564

Lower numbers are better. * Scorecard point awarded.

windows/386-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn58712632490
modernc*483*986*1887
ncruces57531105922028

Lower numbers are better. * Scorecard point awarded.

Results: windows/amd64

  • OS: Windows 11 Pro 23H2
  • CPU: Intel Pentium G4400T @2.9GHz
  • GOMAXPROCS: 2
  • RAM: 8GB
  • Disk: KGB50ZNT256G LS KIOXIA (238GB)

windows/amd64-simple-png

Simpleinsertquery
mattn*29062144
modernc9673*1418
ncruces61861732

Lower numbers are better. * Scorecard point awarded.

windows/amd64-complex-png

Complexinsertquery
mattn*17042520
modernc5590*2149
ncruces40422493

Lower numbers are better. * Scorecard point awarded.

windows/amd64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn992662046
modernc*77*184*1334
ncruces1382631716

Lower numbers are better. * Scorecard point awarded.

windows/amd64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn2588476817242
modernc9031931*7857
ncruces*744*148317187

Lower numbers are better. * Scorecard point awarded.

windows/amd64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn254250029973
modernc*1941*3647*7290
ncruces200441628426

Lower numbers are better. * Scorecard point awarded.

Results: windows/arm64

  • OS: Windows 11 Pro 23H2
  • CPU: Cortex-A72 (Raspberry Pi)
  • GOMAXPROCS: 4
  • RAM: 8GB
  • Disk: Generic SK64 SD Card (64GB)

windows/arm64-simple-png

Simpleinsertquery
mattn*275079376
modernc49023*5796
ncruces361128732

Lower numbers are better. * Scorecard point awarded.

windows/arm64-complex-png

Complexinsertquery
mattn*160309514
modernc26994*6809
ncruces200368110

Lower numbers are better. * Scorecard point awarded.

windows/arm64-many-png

Manyquery/N=10query/N=100query/N=1000
mattn54513929180
modernc*390*884*5440
ncruces78415308863

Lower numbers are better. * Scorecard point awarded.

windows/arm64-large-png

Largequery/N=50000query/N=100000query/N=200000
mattn5035*572017142
modernc52161043850866
ncruces*40178594*16593

Lower numbers are better. * Scorecard point awarded.

windows/arm64-concurrent-png

Concurrentquery/N=2query/N=4query/N=8
mattn8898983619335
modernc*6513*7388*15065
ncruces104351060520925

Lower numbers are better. * Scorecard point awarded.

FAQs

Package last updated on 16 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts