Skip to content

feat: TurboBoto — Zig-accelerated boto3 drop-in replacement#62

Merged
justrach merged 5 commits intomainfrom
faster-boto3
Mar 21, 2026
Merged

feat: TurboBoto — Zig-accelerated boto3 drop-in replacement#62
justrach merged 5 commits intomainfrom
faster-boto3

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

  • Drop-in boto3 replacement: import faster_boto3 as boto3 — one line, same API
  • Zig HTTP transport replaces urllib3 (nanobrew connection pooling pattern)
  • SIMD parsers: XML 44x, timestamps 368x, SigV4 signing 7x faster
  • 1.19x faster S3 GetObject standalone, 115x faster full-stack with TurboAPI
  • 59 tests pass (23 boto3 baseline + 36 parity), Docker CI verified
  • Published: pip install turboboto (PyPI 0.1.0)
  • Frontend: turboboto.zig page deployed to Cloudflare Workers

Benchmark Results

Metric Value
S3 GetObject (standalone) 1.19x faster
S3 ListObjects (standalone) 1.12x faster
Full-stack (TurboAPI + TurboBoto vs FastAPI + boto3) 115-162x
Pure Zig S3 ceiling 1.93x faster than boto3

Test plan

  • 23 boto3 baseline tests (S3 + DynamoDB against LocalStack)
  • 36 faster-boto3 parity tests (vanilla vs patched, byte-for-byte)
  • Docker CI (Dockerfile.test + docker-compose.test.yml)
  • Benchmarks: s3_bench.py, turbo_vs_fast_s3.py

justrach and others added 5 commits March 21, 2026 10:46
Initial structure:
- README.md with approach, architecture, phase plan
- faster_boto3/ package with drop-in patch() API
- Pure Python SigV4 reference implementation + benchmark
- boto3 tests cloned at runtime (not tracked, 551 unit + 905 functional)
- Baseline: Python SigV4 signing at 200k ops/sec (5us/op)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Zig implementation of AWS SigV4 signing hot path:
- derive_signing_key: 4 chained HMAC-SHA256
- sign_string: HMAC-SHA256 -> hex
- sha256_hex: SHA256 -> hex
- sign: all-in-one (derive + sign)

Benchmarks (100k iterations, M3 Pro):
  Python SigV4:     213k ops/sec (4.68us/op)
  Zig SigV4:      1,086k ops/sec (0.92us/op)  -- 5.1x
  Zig SigV4 (split): 1,521k ops/sec (0.66us/op)  -- 7.1x

Passes AWS SigV4 test vectors (deriveSigningKey matches reference).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop-in boto3 replacement powered by Zig HTTP transport:
- `import faster_boto3 as boto3` — one line, same API
- Zig HTTP client replaces urllib3 (nanobrew pattern)
- SIMD parsers: XML 44x, timestamps 368x, SigV4 signing 7x
- 1.19x faster S3 GetObject, 1.12x ListObjects standalone
- 115x faster full-stack with TurboAPI (170K req/s vs 1.5K)
- 36/36 parity tests pass, Docker CI verified
- Python 3.14t free-threaded, GIL disabled

Includes:
- Zig accelerators: HTTP client, SigV4, SIMD parsers, DHI JSON
- Benchmarks: s3_bench.py, turbo_vs_fast_s3.py (wrk-based)
- Tests: test_s3_parity.py (40 tests, S3 + DynamoDB)
- Docker: Dockerfile.test + docker-compose.test.yml
- Frontend: turboboto.zig page (Amazon orange theme, merjs)
- Published: pip install turboboto (PyPI 0.1.0)

Generated with AI

Co-Authored-By: AI <ai@example.com>
- 23 new boto3 baseline tests (S3 + DynamoDB against LocalStack)
  - multipart upload, conditional puts, update expressions
  - content-type, metadata, copy, delete, list
- Fix test_patching_is_idempotent to require localstack fixture
- Total: 63 tests, 59 pass, 2 xfail, 2 xpass, 0 failures

Generated with AI

Co-Authored-By: AI <ai@example.com>
@justrach justrach merged commit f1289a3 into main Mar 21, 2026
6 checks passed
@justrach justrach deleted the faster-boto3 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