Skip to content

Conversation

@euri10
Copy link
Collaborator

@euri10 euri10 commented Feb 2, 2026

wip, trying to figure out if reads are indeed weirdly slow

@euri10
Copy link
Collaborator Author

euri10 commented Feb 2, 2026

im wondering if the sqlalchemy write part does something it feels weird that it would be faster than the base driver

❯ python scripts/bench.py --driver asyncpg --driver sqlite
Running benchmark for driver: asyncpg
Running benchmark for driver: sqlite
                          Benchmark Results
┏━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Driver  ┃ Library    ┃ Scenario       ┃ Time (s) ┃ % Slower vs Raw ┃
┡━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ asyncpg │ raw        │ initialization │   0.0497 │               — │
│ asyncpg │ sqlspec    │ initialization │   0.0977 │           96.6% │
│ asyncpg │ sqlalchemy │ initialization │   0.0329 │          -33.7% │
│ asyncpg │ raw        │ write_heavy    │  51.8678 │               — │
│ asyncpg │ sqlspec    │ write_heavy    │  56.8252 │            9.6% │
│ asyncpg │ sqlalchemy │ write_heavy    │   4.5475 │          -91.2% │
│ asyncpg │ raw        │ read_heavy     │   0.0721 │               — │
│ asyncpg │ sqlspec    │ read_heavy     │   0.1858 │          157.8% │
│ asyncpg │ sqlalchemy │ read_heavy     │   0.1080 │           49.9% │
│ sqlite  │ raw        │ initialization │   0.0007 │               — │
│ sqlite  │ sqlspec    │ initialization │   0.0029 │          343.8% │
│ sqlite  │ sqlalchemy │ initialization │   0.0043 │          555.7% │
│ sqlite  │ raw        │ write_heavy    │   0.0594 │               — │
│ sqlite  │ sqlspec    │ write_heavy    │   2.5934 │         4269.5% │
│ sqlite  │ sqlalchemy │ write_heavy    │   0.7772 │         1209.4% │
│ sqlite  │ raw        │ read_heavy     │   0.0804 │               — │
│ sqlite  │ sqlspec    │ read_heavy     │   2.5633 │         3087.9% │
│ sqlite  │ sqlalchemy │ read_heavy     │   0.7890 │          881.2% │
└─────────┴────────────┴────────────────┴──────────┴─────────────────┘
Benchmarks complete for drivers: asyncpg, sqlite

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