bench2

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2025 License: Unlicense Imports: 5 Imported by: 0

README

logo-png

Go Reference

The SQLite Packages 25.03 Benchmarks Game

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

Category: non database/sql drivers

For the database/sql drivers cateogory please see modernc.org/sqlite-bench

[[TOC]]

Packages

These packages are benchmarked

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 individaul 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 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.

Total Simple Complex Many Large Concurrent
1. zombie 134 16 16 48 8 46
2. eaton 54 12 9 0 33 0
3. craw 20 4 7 0 7 2

Disclaimer: The score and the ranking do not show how will any package perform in your particular application on a particular system.

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

Simple insert query
craw 1432 555
eaton *1242 709
zombie 1809 *290

* scorecard point awarded

darwin/amd64-complex-png

Complex insert query
craw 826 734
eaton *775 983
zombie 1353 *575

* scorecard point awarded

darwin/amd64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 19 66 502
eaton 18 76 632
zombie *10 *27 *219

* scorecard point awarded

darwin/amd64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 213 441 3310
eaton *161 *392 *1965
zombie 180 596 2228

* scorecard point awarded

darwin/amd64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 692 799 1481
eaton 879 973 1829
zombie *446 *519 *948

* 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

Simple insert query
craw 944 385
eaton *872 471
zombie 1371 *210

* scorecard point awarded

darwin/arm64-complex-png

Complex insert query
craw 550 491
eaton *530 628
zombie 1019 *415

* scorecard point awarded

darwin/arm64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 14 48 360
eaton 12 51 423
zombie *7 *22 *175

* scorecard point awarded

darwin/arm64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 150 264 2899
eaton 135 *234 *1518
zombie *129 369 2926

* scorecard point awarded

darwin/arm64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 510 588 1032
eaton 598 685 1384
zombie *283 *358 *658

* 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)
  • Excludes: eaton, does not build

freebsd/amd64-simple-png

Simple insert query
craw *1941 784
zombie 2441 *451

* scorecard point awarded

freebsd/amd64-complex-png

Complex insert query
craw *1163 908
zombie 1717 *724

* scorecard point awarded

freebsd/amd64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 17 76 647
zombie *10 *33 *289

* scorecard point awarded

freebsd/amd64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 303 *574 2701
zombie *280 1152 *2070

* scorecard point awarded

freebsd/amd64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 1017 1950 3759
zombie *627 *1176 *2311

* 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)
  • Excludes: eaton, does not build

freebsd/arm64-simple-png

Simple insert query
craw *26503 11994
zombie 44858 *5287

* scorecard point awarded

freebsd/arm64-complex-png

Complex insert query
craw *14554 20667
zombie 35702 *9948

* scorecard point awarded

freebsd/arm64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 431 1602 12662
zombie *192 *521 *5332

* scorecard point awarded

freebsd/arm64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 5488 *8039 *17065
zombie *4767 16621 28439

* scorecard point awarded

freebsd/arm64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 17275 33841 64233
zombie *6842 *17124 *31192

* 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

Simple insert query
craw 2232 970
eaton *2163 1347
zombie 2999 *509

* scorecard point awarded

linux/386-complex-png

Complex insert query
craw 1293 1112
eaton *1277 1643
zombie 2163 *914

* scorecard point awarded

linux/386-many-png

Many query/N=10 query/N=100 query/N=1000
craw 21 104 847
eaton 32 171 1251
zombie *16 *52 *410

* scorecard point awarded

linux/386-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 78 139 301
eaton 69 *127 *217
zombie *63 254 440

* scorecard point awarded

linux/386-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 316 700 1387
eaton 453 965 1866
zombie *148 *358 *739

* 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

Simple insert query
craw 5785 1760
eaton *5600 2123
zombie 7468 *904

* scorecard point awarded

linux/amd64-complex-png

Complex insert query
craw *2994 1913
eaton 3200 2692
zombie 5452 *1864

* scorecard point awarded

linux/amd64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 65 283 1425
eaton 70 316 2559
zombie *54 *133 *1050

* scorecard point awarded

linux/amd64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 1079 1942 3771
eaton *687 *1327 *2495
zombie 800 2747 4810

* scorecard point awarded

linux/amd64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 1903 4537 8998
eaton 2777 5480 11085
zombie *1264 *2873 *5533

* 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

Simple insert query
craw *1964 999
eaton 2026 1189
zombie 2937 *539

* scorecard point awarded

linux/amd64-0-complex-png

Complex insert query
craw *1157 1143
eaton 1167 1405
zombie 2140 *853

* scorecard point awarded

linux/amd64-0-many-png

Many query/N=10 query/N=100 query/N=1000
craw 24 129 1276
eaton 33 115 1627
zombie *13 *47 *535

* scorecard point awarded

linux/amd64-0-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 338 546 1156
eaton *253 *395 *733
zombie 253 1099 2049

* scorecard point awarded

linux/amd64-0-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 1111 1236 1296
eaton 1276 1418 1486
zombie *606 *686 *817

* 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

Simple insert query
craw 14848 7213
eaton *13376 8211
zombie 20022 *3448

* scorecard point awarded

linux/arm-complex-png

Complex insert query
craw 7882 7517
eaton *7472 9099
zombie 13707 *5137

* scorecard point awarded

linux/arm-many-png

Many query/N=10 query/N=100 query/N=1000
craw 134 704 6590
eaton 145 846 7799
zombie *70 *309 *2732

* scorecard point awarded

linux/arm-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 369 692 1438
eaton 322 *397 *619
zombie *252 798 1302

* scorecard point awarded

linux/arm-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 2210 2613 5343
eaton 2597 3094 5964
zombie *1342 *1541 *3171

* 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

Simple insert query
craw 2726 1391
eaton *2399 1786
zombie 4026 *671

* scorecard point awarded

linux/arm64-complex-png

Complex insert query
craw 1490 1489
eaton *1463 2032
zombie 2917 *1194

* scorecard point awarded

linux/arm64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 25 141 1128
eaton 31 164 1513
zombie *13 *57 *466

* scorecard point awarded

linux/arm64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 635 1094 2026
eaton *407 *651 *1211
zombie 424 762 1222

* scorecard point awarded

linux/arm64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 1593 2187 4481
eaton 1990 2697 5570
zombie *1125 *1712 *2979

* scorecard point awarded

Results: linux/loong64

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

linux/loong64-simple-png

Simple insert query
craw 3939 2036
eaton *3486 2582
zombie 5575 *728

* scorecard point awarded

linux/loong64-complex-png

Complex insert query
craw 2055 2237
eaton *2006 3106
zombie 4195 *1400

* scorecard point awarded

linux/loong64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 47 211 1747
eaton 56 274 2307
zombie *26 *78 *562

* scorecard point awarded

linux/loong64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 376 669 1220
eaton *301 *541 *978
zombie 310 1058 1761

* scorecard point awarded

linux/loong64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 2440 2894 5617
eaton 2785 3587 7021
zombie *1050 *1512 *2863

* 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

Simple insert query
craw 5277 2230
eaton *4811 2797
zombie 8206 *816

* scorecard point awarded

linux/ppc64le-complex-png

Complex insert query
craw *2992 2721
eaton 3015 3402
zombie 5794 *1779

* scorecard point awarded

linux/ppc64le-many-png

Many query/N=10 query/N=100 query/N=1000
craw 41 224 1959
eaton 51 285 2581
zombie *23 *77 *622

* scorecard point awarded

linux/ppc64le-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 116 206 432
eaton *77 *130 *262
zombie 97 245 462

* scorecard point awarded

linux/ppc64le-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 686 1543 2869
eaton 1125 1910 3705
zombie *371 *771 *1411

* 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

Simple insert query
craw 24564 12823
eaton *21461 16837
zombie 55021 *8221

* scorecard point awarded

linux/riscv64-complex-png

Complex insert query
craw 15698 13523
eaton *13579 17835
zombie 44857 *11827

* scorecard point awarded

linux/riscv64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 253 1231 10221
eaton 314 1635 12687
zombie *182 *680 *5133

* scorecard point awarded

linux/riscv64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 7354 16333 32517
eaton *6039 *12004 *19978
zombie 6104 14885 30306

* scorecard point awarded

linux/riscv64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 14058 21302 41492
eaton 19369 24739 48054
zombie *10389 *15797 *28026

* 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

Simple insert query
craw 30117 13939
eaton *25323 16306
zombie 52366 *6094

* scorecard point awarded

linux/s390x-complex-png

Complex insert query
craw 16945 14390
eaton *15138 18155
zombie 42780 *10403

* scorecard point awarded

linux/s390x-many-png

Many query/N=10 query/N=100 query/N=1000
craw 723 1574 11299
eaton 467 1820 14525
zombie *379 *762 *4714

* scorecard point awarded

linux/s390x-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw 12125 24612 41666
eaton 12242 *13049 *25713
zombie *8423 15720 32693

* scorecard point awarded

linux/s390x-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 23978 41608 77902
eaton 32778 50862 96213
zombie *12693 *17368 *35204

* 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)
  • Excludes: eaton, does not build

windows/386-simple-png

Simple insert query
craw *3566 1344
zombie 4376 *612

* scorecard point awarded

windows/386-complex-png

Complex insert query
craw *1755 1443
zombie 3010 *1441

* scorecard point awarded

windows/386-many-png

Many query/N=10 query/N=100 query/N=1000
craw 68 141 1155
zombie *48 *116 *471

* scorecard point awarded

windows/386-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw *194 *295 *22580
zombie 236 431 24448

* scorecard point awarded

windows/386-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw *520 *933 1402
zombie 715 992 *1185

* 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

Simple insert query
craw 2644 1117
eaton *2465 1446
zombie 3337 *519

* scorecard point awarded

windows/amd64-complex-png

Complex insert query
craw *1451 1292
eaton 1490 1752
zombie 2409 *894

* scorecard point awarded

windows/amd64-many-png

Many query/N=10 query/N=100 query/N=1000
craw 68 150 1014
eaton 74 187 1362
zombie *54 *84 *385

* scorecard point awarded

windows/amd64-large-png

Large query/N=50000 query/N=100000 query/N=200000
craw *762 1538 2943
eaton 782 *1369 *2784
zombie 1079 2067 3518

* scorecard point awarded

windows/amd64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
craw 1464 2892 5581
eaton 1759 3614 7262
zombie *715 *1554 *3006

* 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)
  • Excludes: craw, does not build

windows/arm64-simple-png

Simple insert query
eaton *8177 4639
zombie 13235 *1801

* scorecard point awarded

windows/arm64-complex-png

Complex insert query
eaton *5061 5281
zombie 8956 *2915

* scorecard point awarded

windows/arm64-many-png

Many query/N=10 query/N=100 query/N=1000
eaton 285 691 4492
zombie *206 *317 *1480

* scorecard point awarded

windows/arm64-large-png

Large query/N=50000 query/N=100000 query/N=200000
eaton *2698 *5806 25009
zombie 4352 8503 *15617

* scorecard point awarded

windows/arm64-concurrent-png

Concurrent query/N=2 query/N=4 query/N=8
eaton 5113 6161 12055
zombie *2897 *3569 *6403

* scorecard point awarded

Documentation

Overview

Package bench2 collects benchmarks of selected Go SQLite non database/sql driver packages. The results are found in the README.md file.

On pkg.go.dev click "Expand" above to expand the README file section or use the headings list available on the left of the desktop or above on themobile site to navigate the README file.

Caveat emptor

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL