Skip to main content
We compare FluxCRUD against SQLAlchemy and FastCRUD (a popular alternative) to measure overhead and performance.
Environment: SQLite (aiosqlite), Python 3.10, Linux. Operations: 1000 items.

Results

OperationImplementationTime (s)Ops/secNotes
InsertFluxCRUD (Batcher)0.12s~8,000Uses batch_writer (Chunked Inserts)
Raw SQLAlchemy (Bulk)0.21s~4,600session.add_all + commit
FluxCRUD (Simple)0.76s~1,300Sequential await repo.create()
FastCRUD0.80s~1,250Sequential await crud.create()
ReadRaw SQLAlchemy0.27s~3,700Baseline
FluxCRUD (Direct)0.32s~3,100Fastest ORM-wrapper (Default)
FastCRUD0.43s~2,300
FluxCRUD (Loader)0.50s~2,000N+1 Safe (Opt-in)

Analysis

1. High Performance Writes

FluxCRUD’s Batcher (repo.batch_writer) significantly outperforms sequential inserts (~4x faster) and rivals raw bulk inserts.

2. Read Performance

FluxCRUD is now Fast by Default. Use Repository(..., use_loader=False) (default) for maximum speed.
  1. Direct Read: By bypassing the DataLoader and inlining operations, FluxCRUD is ~35% faster than FastCRUD.
  2. Safety Option: You can opt-in to use_loader=True for complex graph queries. This adds overhead (~50% slower than direct) but prevents N+1 issues automatically.
  3. Low Overhead: FluxCRUD adds minimal overhead (~0.05s per 1000 items) over raw SQLAlchemy.

3. Developer Experience

  • FluxCRUD provides the Batcher out-of-the-box for high-throughput jobs.
  • FastCRUD and FluxCRUD have similar performance for basic sequential operations, but FluxCRUD offers more robust tools (Caching, Batching) for scaling.

Running the Benchmark

uv run python benchmarks/comparison.py