Skip to content

⚡ B-FAST v1.7.0 - FastAPI Middleware & Zero-Copy Engine Optimizations

Choose a tag to compare

@marcelomarkus marcelomarkus released this 24 Sep 20:34
· 39 commits to main since this release
8e7ee6f

🚀 What's New in v1.7.0

🌐 Transparent FastAPI & ASGI Content Negotiation Middleware

  • BFastMiddleware: Transparent ASGI middleware in b_fast.fastapi supporting automatic content negotiation via Accept: application/x-bfast (with fallback to application/vnd.bfast).
  • Zero-Code Endpoint Migration: Accelerate existing JSON endpoints (return {"hello": "world"}) without modifying handler signatures or return types.
  • Smart Protocol Handling: Preserves empty bodies (204 No Content, 304 Not Modified), non-JSON payloads, explicit binary responses, and errors untouched.
  • Zero External Dependencies: Pure Python standard library json.loads combined with the native Rust B-FAST encoder.
  • Full Support for Explicit Modes: First-class exports of BFastResponse and BFastStreamingResponse for direct high-throughput and NDJSON-replacement streaming routes.

📊 CodSpeed Official Validation

  • 29 benchmark suites tested with zero performance regressions.
  • test_encode_100_uncompressed: 598 ns
  • test_encode_1k_uncompressed: 47.51 µs (-21.0%)
  • test_encode_nested_dicts_1k: 463.57 µs (2.1x speedup)
  • test_stream_decode_1k_frames: 293.30 µs (> 3.4M frames/sec)

📦 Distribution

  • PyPI (bfast-py): Native wheels for Linux, macOS, and Windows with provenance attestations.
  • NPM (bfast-client): TypeScript client v1.7.0 published with provenance.