turboapi 0.3.23__tar.gz → 0.3.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. {turboapi-0.3.23 → turboapi-0.3.24}/AGENTS.md +5 -3
  2. {turboapi-0.3.23 → turboapi-0.3.24}/Cargo.lock +1 -1
  3. {turboapi-0.3.23 → turboapi-0.3.24}/Cargo.toml +1 -1
  4. {turboapi-0.3.23 → turboapi-0.3.24}/PKG-INFO +1 -1
  5. {turboapi-0.3.23 → turboapi-0.3.24}/README.md +22 -22
  6. {turboapi-0.3.23 → turboapi-0.3.24}/pyproject.toml +1 -1
  7. {turboapi-0.3.23 → turboapi-0.3.24}/python/pyproject.toml +1 -1
  8. {turboapi-0.3.23 → turboapi-0.3.24}/src/server.rs +5 -3
  9. {turboapi-0.3.23 → turboapi-0.3.24}/.github/scripts/check_performance_regression.py +0 -0
  10. {turboapi-0.3.23 → turboapi-0.3.24}/.github/scripts/compare_benchmarks.py +0 -0
  11. {turboapi-0.3.23 → turboapi-0.3.24}/.github/workflows/README.md +0 -0
  12. {turboapi-0.3.23 → turboapi-0.3.24}/.github/workflows/benchmark.yml +0 -0
  13. {turboapi-0.3.23 → turboapi-0.3.24}/.github/workflows/build-and-release.yml +0 -0
  14. {turboapi-0.3.23 → turboapi-0.3.24}/.github/workflows/build-wheels.yml +0 -0
  15. {turboapi-0.3.23 → turboapi-0.3.24}/.github/workflows/ci.yml +0 -0
  16. {turboapi-0.3.23 → turboapi-0.3.24}/.github/workflows/release.yml +0 -0
  17. {turboapi-0.3.23 → turboapi-0.3.24}/.gitignore +0 -0
  18. {turboapi-0.3.23 → turboapi-0.3.24}/CHANGELOG.md +0 -0
  19. {turboapi-0.3.23 → turboapi-0.3.24}/FASTAPI_COMPATIBILITY.md +0 -0
  20. {turboapi-0.3.23 → turboapi-0.3.24}/FASTAPI_FIXES_SUMMARY.md +0 -0
  21. {turboapi-0.3.23 → turboapi-0.3.24}/LICENSE +0 -0
  22. {turboapi-0.3.23 → turboapi-0.3.24}/PYTHON_313_FREE_THREADING_SETUP.md +0 -0
  23. {turboapi-0.3.23 → turboapi-0.3.24}/PYTHON_SETUP_COMPLETE.md +0 -0
  24. {turboapi-0.3.23 → turboapi-0.3.24}/RELEASE_NOTES_v0.3.1.md +0 -0
  25. {turboapi-0.3.23 → turboapi-0.3.24}/RELEASE_NOTES_v0.3.13.md +0 -0
  26. {turboapi-0.3.23 → turboapi-0.3.24}/WINDOWS_FIX_SUMMARY.md +0 -0
  27. {turboapi-0.3.23 → turboapi-0.3.24}/adaptive_rate_test.py +0 -0
  28. {turboapi-0.3.23 → turboapi-0.3.24}/benches/performance_bench.rs +0 -0
  29. {turboapi-0.3.23 → turboapi-0.3.24}/benchmark_comparison.png +0 -0
  30. {turboapi-0.3.23 → turboapi-0.3.24}/benchmark_graphs/turbo_vs_fastapi_performance_20250929_025531.png +0 -0
  31. {turboapi-0.3.23 → turboapi-0.3.24}/benchmark_output.txt +0 -0
  32. {turboapi-0.3.23 → turboapi-0.3.24}/claude.md +0 -0
  33. {turboapi-0.3.23 → turboapi-0.3.24}/delete/blog/adr_python_handler_integration.md +0 -0
  34. {turboapi-0.3.23 → turboapi-0.3.24}/delete/blog/phase_1.md +0 -0
  35. {turboapi-0.3.23 → turboapi-0.3.24}/delete/blog/phase_2.md +0 -0
  36. {turboapi-0.3.23 → turboapi-0.3.24}/delete/blog/phase_3.md +0 -0
  37. {turboapi-0.3.23 → turboapi-0.3.24}/delete/blog/phase_4.md +0 -0
  38. {turboapi-0.3.23 → turboapi-0.3.24}/delete/blog/phase_5.md +0 -0
  39. {turboapi-0.3.23 → turboapi-0.3.24}/delete/twitterpost.md +0 -0
  40. {turboapi-0.3.23 → turboapi-0.3.24}/install_benchmark_deps.py +0 -0
  41. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/001-foundation.md +0 -0
  42. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/002-routing-breakthrough.md +0 -0
  43. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/003-production-ready.md +0 -0
  44. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/004-zero-copy-revolution.md +0 -0
  45. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/005-middleware-mastery.md +0 -0
  46. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/006-python-handler-breakthrough.md +0 -0
  47. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/README.md +0 -0
  48. {turboapi-0.3.23 → turboapi-0.3.24}/mini-notes/lessons-learned.md +0 -0
  49. {turboapi-0.3.23 → turboapi-0.3.24}/python/MANIFEST.in +0 -0
  50. {turboapi-0.3.23 → turboapi-0.3.24}/python/setup.py +0 -0
  51. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/__init__.py +0 -0
  52. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/decorators.py +0 -0
  53. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/main_app.py +0 -0
  54. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/middleware.py +0 -0
  55. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/models.py +0 -0
  56. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/request_handler.py +0 -0
  57. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/routing.py +0 -0
  58. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/rust_integration.py +0 -0
  59. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/server_integration.py +0 -0
  60. {turboapi-0.3.23 → turboapi-0.3.24}/python/turboapi/version_check.py +0 -0
  61. {turboapi-0.3.23 → turboapi-0.3.24}/setup_python313t.sh +0 -0
  62. {turboapi-0.3.23 → turboapi-0.3.24}/src/http2.rs +0 -0
  63. {turboapi-0.3.23 → turboapi-0.3.24}/src/lib.rs +0 -0
  64. {turboapi-0.3.23 → turboapi-0.3.24}/src/micro_bench.rs +0 -0
  65. {turboapi-0.3.23 → turboapi-0.3.24}/src/middleware.rs +0 -0
  66. {turboapi-0.3.23 → turboapi-0.3.24}/src/request.rs +0 -0
  67. {turboapi-0.3.23 → turboapi-0.3.24}/src/response.rs +0 -0
  68. {turboapi-0.3.23 → turboapi-0.3.24}/src/router.rs +0 -0
  69. {turboapi-0.3.23 → turboapi-0.3.24}/src/threadpool.rs +0 -0
  70. {turboapi-0.3.23 → turboapi-0.3.24}/src/validation.rs +0 -0
  71. {turboapi-0.3.23 → turboapi-0.3.24}/src/websocket.rs +0 -0
  72. {turboapi-0.3.23 → turboapi-0.3.24}/src/zerocopy.rs +0 -0
  73. {turboapi-0.3.23 → turboapi-0.3.24}/test_no_rate_limit.py +0 -0
  74. {turboapi-0.3.23 → turboapi-0.3.24}/test_rate_limiting.py +0 -0
  75. {turboapi-0.3.23 → turboapi-0.3.24}/test_zerocopy.py +0 -0
  76. {turboapi-0.3.23 → turboapi-0.3.24}/tests/README.md +0 -0
  77. {turboapi-0.3.23 → turboapi-0.3.24}/tests/async_benchmark.sh +0 -0
  78. {turboapi-0.3.23 → turboapi-0.3.24}/tests/benchmark_comparison.py +0 -0
  79. {turboapi-0.3.23 → turboapi-0.3.24}/tests/comparison_before_after.py +0 -0
  80. {turboapi-0.3.23 → turboapi-0.3.24}/tests/fastapi_equivalent.py +0 -0
  81. {turboapi-0.3.23 → turboapi-0.3.24}/tests/fastapi_v0_3_20_equivalent.py +0 -0
  82. {turboapi-0.3.23 → turboapi-0.3.24}/tests/quick_benchmark.sh +0 -0
  83. {turboapi-0.3.23 → turboapi-0.3.24}/tests/quick_body_test.py +0 -0
  84. {turboapi-0.3.23 → turboapi-0.3.24}/tests/quick_test.py +0 -0
  85. {turboapi-0.3.23 → turboapi-0.3.24}/tests/run_v0_3_20_benchmark.py +0 -0
  86. {turboapi-0.3.23 → turboapi-0.3.24}/tests/test.py +0 -0
  87. {turboapi-0.3.23 → turboapi-0.3.24}/tests/test_async_benchmark.py +0 -0
  88. {turboapi-0.3.23 → turboapi-0.3.24}/tests/test_fastapi_compatibility.py +0 -0
  89. {turboapi-0.3.23 → turboapi-0.3.24}/tests/test_v0_3_20_fixes.py +0 -0
  90. {turboapi-0.3.23 → turboapi-0.3.24}/tests/test_v0_3_20_server.py +0 -0
  91. {turboapi-0.3.23 → turboapi-0.3.24}/tests/test_v0_3_21_async.py +0 -0
  92. {turboapi-0.3.23 → turboapi-0.3.24}/tests/wrk_benchmark.py +0 -0
  93. {turboapi-0.3.23 → turboapi-0.3.24}/tests/wrk_comparison.py +0 -0
  94. {turboapi-0.3.23 → turboapi-0.3.24}/turbo_vs_fastapi_benchmark_20250929_025526.json +0 -0
  95. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/__init__.py +0 -0
  96. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/decorators.py +0 -0
  97. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/main_app.py +0 -0
  98. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/middleware.py +0 -0
  99. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/models.py +0 -0
  100. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/request_handler.py +0 -0
  101. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/routing.py +0 -0
  102. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/rust_integration.py +0 -0
  103. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/server_integration.py +0 -0
  104. {turboapi-0.3.23 → turboapi-0.3.24}/turboapi/version_check.py +0 -0
  105. {turboapi-0.3.23 → turboapi-0.3.24}/wrk_rate_limit_test.py +0 -0
@@ -1,15 +1,17 @@
1
- # TurboAPI v0.3.0+ - AI Agent Guide 🤖
1
+ # TurboAPI v0.3.23 - AI Agent Guide 🤖
2
2
 
3
3
  **For AI assistants, code generation tools, and automated development systems**
4
4
 
5
5
  ## 🎯 **What TurboAPI Is**
6
6
 
7
- TurboAPI is a **FastAPI-compatible** Python web framework that delivers **5-10x better performance** through:
7
+ TurboAPI is a **FastAPI-compatible** Python web framework that delivers **9-10x better performance** through:
8
8
  - **Rust-powered HTTP core** (zero Python overhead)
9
- - **Python 3.13 free-threading** support (true parallelism)
9
+ - **Python 3.13 free-threading** with `Python::attach()` (TRUE parallel execution)
10
+ - **pyo3-async-runtimes** integration (native tokio async support)
10
11
  - **Zero-copy optimizations** and intelligent caching
11
12
  - **100% FastAPI syntax compatibility** with automatic body parsing
12
13
  - **Satya validation** (faster than Pydantic)
14
+ - **72,000+ req/s** in production benchmarks
13
15
 
14
16
  ## 🚀 **For AI Agents: Key Facts**
15
17
 
@@ -1439,7 +1439,7 @@ dependencies = [
1439
1439
 
1440
1440
  [[package]]
1441
1441
  name = "turbonet"
1442
- version = "0.3.23"
1442
+ version = "0.3.24"
1443
1443
  dependencies = [
1444
1444
  "anyhow",
1445
1445
  "bytes",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "turbonet"
3
- version = "0.3.23"
3
+ version = "0.3.24"
4
4
  edition = "2021"
5
5
  authors = ["Rach Pradhan <rach@turboapi.dev>"]
6
6
  description = "High-performance Python web framework core - Rust-powered HTTP server with Python 3.13 free-threading support"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: turboapi
3
- Version: 0.3.23
3
+ Version: 0.3.24
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -1,12 +1,13 @@
1
1
  # TurboAPI 🚀
2
2
 
3
- **The Python web framework that gives you FastAPI's beloved developer experience with 5-10x the performance.**
3
+ **The Python web framework that gives you FastAPI's beloved developer experience with 9-10x the performance.**
4
4
 
5
- Built with Rust for revolutionary speed, designed with Python for developer happiness.
5
+ Built with Rust for revolutionary speed, designed with Python for developer happiness. **First framework to leverage Python 3.13 free-threading for true parallel request handling!**
6
6
 
7
7
  > **⚡ Try it in 30 seconds:** `python live_performance_showcase.py` → Visit `http://127.0.0.1:8080`
8
- > **🔥 See the difference:** Same FastAPI syntax, 5-10x faster performance!
9
- > **🎯 Zero migration effort:** Change 1 import line, keep all your existing code
8
+ > **🔥 72,000+ requests/sec:** 9-10x faster than FastAPI in real benchmarks!
9
+ > **🎯 Zero migration effort:** Change 1 import line, keep all your existing code
10
+ > **🧵 Python 3.13 Free-Threading:** TRUE parallel Python execution - no GIL!
10
11
 
11
12
  ## 🎨 **100% FastAPI-Compatible Developer Experience**
12
13
 
@@ -46,32 +47,31 @@ app.run(host="127.0.0.1", port=8000)
46
47
 
47
48
  ## 🚀 **Revolutionary Performance**
48
49
 
49
- ### **Why TurboAPI is 5-10x Faster**
50
+ ### **Why TurboAPI is 9-10x Faster**
50
51
  - **🦀 Rust-Powered HTTP Core**: Zero Python overhead for request handling
51
52
  - **⚡ Zero Middleware Overhead**: Rust-native middleware pipeline
52
- - **🧵 Free-Threading Ready**: True parallelism for Python 3.13+
53
+ - **🧵 Python 3.13 Free-Threading**: TRUE parallel Python execution with `Python::attach()`
53
54
  - **💾 Zero-Copy Optimizations**: Direct memory access, no Python copying
54
- - **🔄 Intelligent Caching**: Response caching with TTL optimization
55
+ - **🔄 pyo3-async-runtimes**: Native tokio integration for async handlers
56
+ - **🎯 Multi-threaded**: 3x CPU cores worker threads for maximum throughput
55
57
 
56
- ### **Benchmark Results vs FastAPI** (wrk load testing)
57
-
58
- ![Benchmark Comparison](benchmark_comparison.png)
58
+ ### **Benchmark Results vs FastAPI** (v0.3.23 - wrk, 4 threads, 100 connections)
59
59
 
60
60
  ```
61
- 🎯 Light Load (50 connections):
62
- Root Endpoint: 42,803 req/s (TurboAPI) vs 8,078 req/s (FastAPI) = 5.3x faster
63
- Simple Endpoint: 43,375 req/s (TurboAPI) vs 8,536 req/s (FastAPI) = 5.1x faster
64
- JSON Endpoint: 41,696 req/s (TurboAPI) vs 3,208 req/s (FastAPI) = 13.0x faster
61
+ 🎯 TurboAPI v0.3.23 (Python 3.13 Free-Threading):
62
+ Simple GET: 72,903 req/s | Latency: ~1.4ms
63
+ Parameterized: 71,690 req/s | Latency: ~1.4ms
64
+ Async Handlers: 13,417 req/s | Latency: ~7.5ms
65
65
 
66
- 🎯 Medium Load (200 connections):
67
- Root Endpoint: 42,874 req/s (TurboAPI) vs 8,220 req/s (FastAPI) = 5.2x faster
68
- Simple Endpoint: 43,592 req/s (TurboAPI) vs 8,542 req/s (FastAPI) = 5.1x faster
69
- JSON Endpoint: 41,822 req/s (TurboAPI) vs 3,190 req/s (FastAPI) = 13.1x faster
66
+ 🎯 FastAPI (uvicorn):
67
+ Simple GET: 8,337 req/s | Latency: ~12ms
68
+ Parameterized: 7,413 req/s | Latency: ~13ms
69
+ Async Handlers: 8,337 req/s | Latency: ~12ms
70
70
 
71
- 🎯 Heavy Load (500 connections):
72
- Root Endpoint: 43,057 req/s (TurboAPI) vs 7,897 req/s (FastAPI) = 5.5x faster
73
- Simple Endpoint: 43,525 req/s (TurboAPI) vs 8,092 req/s (FastAPI) = 5.4x faster
74
- JSON Endpoint: 42,743 req/s (TurboAPI) vs 3,099 req/s (FastAPI) = 13.8x faster
71
+ 📊 Performance Comparison:
72
+ Sync Handlers: 9.0x faster than FastAPI 🚀🚀🚀
73
+ Async Handlers: 1.6x faster than FastAPI
74
+ Latency: 8.5x lower than FastAPI
75
75
 
76
76
  🚀 Summary:
77
77
  • Average speedup: 5-13x faster than FastAPI
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "turboapi"
7
- version = "0.3.23"
7
+ version = "0.3.24"
8
8
  description = "Revolutionary Python web framework with FastAPI syntax and 5-10x performance (Python 3.13+ free-threading required)"
9
9
  requires-python = ">=3.13"
10
10
  license = {text = "MIT"}
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "turboapi"
7
- version = "0.3.23"
7
+ version = "0.3.24"
8
8
  description = "Revolutionary Python web framework with FastAPI syntax and 5-10x performance (Python 3.13+ free-threading required)"
9
9
  requires-python = ">=3.13"
10
10
  license = {text = "MIT"}
@@ -468,13 +468,15 @@ fn call_python_handler_fast(
468
468
 
469
469
  // Handle sync vs async results differently
470
470
  if is_coroutine {
471
- // Async handler - use pyo3-async-runtimes to convert Python coroutine to Rust future
472
- // This integrates with tokio's runtime for true async performance!
471
+ // Async handler - use pyo3-async-runtimes for tokio integration
472
+ // NOTE: Still uses block_in_place() - true async requires making handle_request async
473
+ // Current performance: ~13K RPS (vs 72K for sync)
474
+ // Future optimization: Make entire request pipeline async (v0.4.0)
473
475
 
474
476
  // Convert Python coroutine to Rust future using pyo3-async-runtimes
475
477
  let rust_future = pyo3_async_runtimes::tokio::into_future(result.clone_ref(py).into_bound(py))?;
476
478
 
477
- // Await the Rust future in tokio's runtime (blocking this thread)
479
+ // Await the future (releases Python but blocks tokio thread)
478
480
  let awaited_result = py.allow_threads(|| {
479
481
  tokio::task::block_in_place(|| {
480
482
  tokio::runtime::Handle::current().block_on(rust_future)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes