Skip to content

bench: asyncpg vs TurboAPI+pg.zig Docker benchmarks#56

Merged
justrach merged 2 commits intomainfrom
postgres-benchmarks
Mar 20, 2026
Merged

bench: asyncpg vs TurboAPI+pg.zig Docker benchmarks#56
justrach merged 2 commits intomainfrom
postgres-benchmarks

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

  • Added reproducible Docker benchmark: asyncpg vs TurboAPI+pg.zig (Postgres 18)
  • Each test runs in its own subprocess (no resource contention)
  • 4 configs: asyncpg concurrent, Turbo cached, Turbo no-cache, Turbo raw SQL

Results

Test asyncpg Turbo cached Turbo no-cache Turbo raw
SELECT by ID 19k/s 361k/s (18.4x) 83k/s (4.3x) 64k/s (3.3x)
SELECT list 18k/s 391k/s (21.3x) 353k/s (19.2x) 376k/s (20.4x)
Raw ILIKE 12k/s n/a n/a 350k/s (28.7x)

Reproduce

cd benchmarks/postgres
docker compose up --build

Test plan

  • Ran full benchmark in Docker (Postgres 18, Python 3.14t)
  • Sequential subprocess execution (no contention)
  • Results documented in BENCHMARKS.md

justrach and others added 2 commits March 21, 2026 00:28
Fully reproducible: cd benchmarks/postgres && docker compose up --build

Each test runs in its own subprocess (no resource contention).
Tests: asyncpg concurrent, Turbo cached, Turbo no-cache (varying IDs
via lua), Turbo raw SQL (random + ILIKE).

Results (Postgres 18, Docker, sequential, aarch64):
  Cached by-ID:   18.4x vs asyncpg (361k vs 19k)
  No-cache by-ID: 4.3x vs asyncpg (83k vs 19k)
  Cached list:    21.3x vs asyncpg (391k vs 18k)
  No-cache list:  19.2x vs asyncpg (353k vs 18k)
  Raw ILIKE:      28.7x vs asyncpg (350k vs 12k)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@justrach justrach merged commit 8969d8e into main Mar 20, 2026
5 of 6 checks passed
@justrach justrach deleted the postgres-benchmarks branch April 14, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant