Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ tasks:
- '{{.BAR}} --stack pool/bench/pool-8cpu.txt -n "Pool (8 CPUs)" --id pool-8cpu -d "Same matrix at GOMAXPROCS 8" -o {{.DATA}}/pool-8cpu.json'
- '{{.BAR}} --stack pool/bench/pool-4cpu.txt -n "Pool (4 CPUs)" --id pool-4cpu -d "Same matrix at GOMAXPROCS 4" -o {{.DATA}}/pool-4cpu.json'
- >-
{{.BAR}} redis/bench/redis.txt -n "Redis (Persistent)" --id redis-persistent
{{.BAR}} --stack redis/bench/redis.txt -n "Redis (Persistent)" --id redis-persistent
-d "One consumer process: VarMQ persistent queue vs Asynq, rmq, taskq, gocraft/work; plus enqueue-only and pickup latency"
-f '^(Benchmark)?(Durable/[^/]+C1|Enqueue/Enqueue|Latency/[^/]+)/[^/]+/{{.SUBJECTS}}$'
--better p50-ms:low,p99-ms:low,max-ms:low
-o {{.DATA}}/redis-persistent.json
- >-
{{.BAR}} redis/bench/redis.txt -n "Redis (Distributed)" --id redis-distributed
{{.BAR}} --stack redis/bench/redis.txt -n "Redis (Distributed)" --id redis-distributed
-d "Four consumer processes: VarMQ distributed queue vs Asynq, rmq, taskq, gocraft/work"
-f '^(Benchmark)?Durable/[^/]+C4/'
-o {{.DATA}}/redis-distributed.json
- >-
{{.BAR}} sqlite/bench/sqlite.txt -n "Sqlite (Persistent)" --id sqlite-persistent
{{.BAR}} --stack sqlite/bench/sqlite.txt -n "Sqlite (Persistent)" --id sqlite-persistent
-d "sqliteq through a VarMQ worker: one queue, drain, priority, ten queues; WAL checkpoint 1000 vs 10000 pages"
--better walMB:low -o {{.DATA}}/sqlite-persistent.json
- jq -se 'all(.data | length > 0)' {{.JSONS}}
Expand Down
20 changes: 11 additions & 9 deletions sqlite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ WAL size.

| Scenario | Layout | ckpt1000 | ckpt10000 | walMB 1000 / 10000 |
|----------|--------|---------:|----------:|-------------------:|
| `Mixed1Q` | SingleFile | 6,351 | 10,236 | 4.2 / 41.2 |
| `Drain1Q` | SingleFile | 14,020 | 19,169 | 4.1 / 41.2 |
| `DrainPrio` | SingleFile | 12,320 | 24,036 | 4.1 / 41.2 |
| `Mixed10Q` | Folder | 21,058 | 69,482 | 4.1 / 39.8 |
| `Mixed10Q` | SingleFile | 5,255 | 11,578 | 4.2 / 41.3 |
| `Mixed1Q` | SingleFile | 6,579 | 9,640 | 4.2 / 41.2 |
| `Drain1Q` | SingleFile | 12,397 | 17,577 | 4.2 / 41.2 |
| `DrainPrio` | SingleFile | 11,027 | 16,918 | 4.2 / 41.2 |
| `Mixed10Q` | SingleFile | 4,290 | 8,678 | 4.2 / 41.3 |
| `Mixed10Q` | Folder | 22,675 | 34,935 | 4.1 / 39.4 |

A 10,000-page checkpoint runs 1.4 to 3.3x faster than the 1,000-page default
A 10,000-page checkpoint runs 1.4 to 2.0x faster than the 1,000-page default
and holds a WAL about ten times larger (41 MB against 4 MB at this payload).
Ten queues in separate files run 4 to 6x faster than the same ten in one
file, which fits SQLite allowing one writer per database file. The machine
and disk change these numbers a lot, so compare runs on the same machine only.
Ten queues in separate files run 4 to 5x faster than the same ten in one
file, which fits SQLite allowing one writer per database file. Two runs an
hour apart on the same machine differed by up to 2x on the ckpt10000 rows, so
read the ratios, not the absolute numbers, and compare runs on the same machine
only.
22 changes: 11 additions & 11 deletions sqlite/bench/sqlite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ goos: linux
goarch: amd64
pkg: github.com/goptics/benchmarks/sqlite
cpu: 13th Gen Intel(R) Core(TM) i7-13700
BenchmarkSQLite/Mixed1Q/SingleFile/ckpt1000-24 2 3149068829 ns/op 6351 jobs/s 4.153 walMB
BenchmarkSQLite/Mixed1Q/SingleFile/ckpt10000-24 2 1953916054 ns/op 10236 jobs/s 41.22 walMB
BenchmarkSQLite/Drain1Q/SingleFile/ckpt1000-24 2 1426568010 ns/op 14020 jobs/s 4.145 walMB
BenchmarkSQLite/Drain1Q/SingleFile/ckpt10000-24 2 1043378285 ns/op 19169 jobs/s 41.22 walMB
BenchmarkSQLite/DrainPrio/SingleFile/ckpt1000-24 2 811688704 ns/op 12320 jobs/s 4.149 walMB
BenchmarkSQLite/DrainPrio/SingleFile/ckpt10000-24 2 416049300 ns/op 24036 jobs/s 41.22 walMB
BenchmarkSQLite/Mixed10Q/Folder/ckpt1000-24 2 949778238 ns/op 21058 jobs/s 4.132 walMB
BenchmarkSQLite/Mixed10Q/Folder/ckpt10000-24 2 287843161 ns/op 69482 jobs/s 39.75 walMB
BenchmarkSQLite/Mixed10Q/SingleFile/ckpt1000-24 2 3805894852 ns/op 5255 jobs/s 4.244 walMB
BenchmarkSQLite/Mixed10Q/SingleFile/ckpt10000-24 2 1727460905 ns/op 11578 jobs/s 41.29 walMB
BenchmarkSQLite/Mixed1Q/SingleFile/ckpt1000-24 2 3039747602 ns/op 6579 jobs/s 4.161 walMB
BenchmarkSQLite/Mixed1Q/SingleFile/ckpt10000-24 2 2074583028 ns/op 9640 jobs/s 41.22 walMB
BenchmarkSQLite/Drain1Q/SingleFile/ckpt1000-24 2 1613315062 ns/op 12397 jobs/s 4.157 walMB
BenchmarkSQLite/Drain1Q/SingleFile/ckpt10000-24 2 1137877831 ns/op 17577 jobs/s 41.22 walMB
BenchmarkSQLite/DrainPrio/SingleFile/ckpt1000-24 2 906832514 ns/op 11027 jobs/s 4.153 walMB
BenchmarkSQLite/DrainPrio/SingleFile/ckpt10000-24 2 591091365 ns/op 16918 jobs/s 41.21 walMB
BenchmarkSQLite/Mixed10Q/SingleFile/ckpt1000-24 2 4662094013 ns/op 4290 jobs/s 4.231 walMB
BenchmarkSQLite/Mixed10Q/SingleFile/ckpt10000-24 2 2304644819 ns/op 8678 jobs/s 41.31 walMB
BenchmarkSQLite/Mixed10Q/Folder/ckpt1000-24 2 882018262 ns/op 22675 jobs/s 4.145 walMB
BenchmarkSQLite/Mixed10Q/Folder/ckpt10000-24 2 572491534 ns/op 34935 jobs/s 39.43 walMB
PASS
ok github.com/goptics/benchmarks/sqlite 59.913s
ok github.com/goptics/benchmarks/sqlite 66.554s
4 changes: 3 additions & 1 deletion sqlite/harness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ var scenarios = []scenario{
{name: "Mixed1Q", queues: 1, producers: 4, total: 20000, layouts: []layout{singleFile}},
{name: "Drain1Q", queues: 1, producers: 4, total: 20000, drain: true, layouts: []layout{singleFile}},
{name: "DrainPrio", queues: 1, producers: 4, total: 10000, drain: true, priority: true, layouts: []layout{singleFile}},
{name: "Mixed10Q", queues: 10, producers: 1, total: 20000, layouts: []layout{folder, singleFile}},
// SingleFile first: vizb orders chart series by the first layout seen in
// the whole file, and the one-queue scenarios only have SingleFile.
{name: "Mixed10Q", queues: 10, producers: 1, total: 20000, layouts: []layout{singleFile, folder}},
}

// benchRoot is where the benchmark databases live. They must be on a real disk:
Expand Down
Loading