Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

b4n1-boost

The Python Accelerator. Native middleware for Django, FastAPI and Flask — JSON 10x faster, compression 28x faster.

b4n1-boost ships as a precompiled native extension, so there is nothing to compile on your machine. Drop it into an existing project and the hot paths — serialization, compression, static assets — run in native code while your application code stays exactly the same.

What it does

AreaWhat you get
JSONUp to 10.5x faster dumps, canonical form, validation, batch operations
CompressionGzip, Zstd (28x faster) and Brotli, with Content-Type awareness
MiddlewareETag/304, security headers, CORS, rate limiting, health check, caching
ORMBulk insert through PostgreSQL COPY, 5-10x faster than the ORM path
SerializersDjango REST Framework output without the serializer overhead
UtilitiesJWT validation, HTML/CSS/JS minification, HTML → Markdown
BackgroundWorker-thread offloading with no external queue broker

Who it is for

  • Teams whose Django or FastAPI app is CPU-bound on serialization or compression
  • Applications serving large JSON payloads or heavy static assets
  • Projects that want native speed without adding a service (no Redis, no broker)

Where to go next

Design notes

Everything runs in-process. There is no daemon, no sidecar and no network hop: b4n1-boost is a library you import. When the native core is unavailable, the documented fallbacks are explicit — the package never silently pretends a fast path is active. Call status() at any time to see exactly which engines are live (see Status & Diagnostics).