Skip to content

Commit 2fe3789

Browse files
author
patx
committed
added performance benchmarks to readme
1 parent 476ef4c commit 2fe3789

File tree

8 files changed

+20
-142
lines changed

8 files changed

+20
-142
lines changed

MicroPie.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ async def asgi_app(self, scope: Dict[str, Any], receive: Any, send: Any) -> None
8989
cookies = self._parse_cookies(headers_dict.get("cookie", ""))
9090

9191
session_id = cookies.get("session_id")
92-
9392
if session_id and session_id in self.sessions:
9493
self.session = self.sessions[session_id]
9594
self.session["last_access"] = time.time()

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- 🎨 **Templates:** Jinja2, if installed, for rendering dynamic HTML pages.
1111
-**ASGI-Powered:** Built w/ asynchronous support for modern web servers like Uvicorn and Daphne, enabling high concurrency.
1212
- 🛠️ **Lightweight Design:** Minimal dependencies for faster development and deployment.
13-
-**Blazing Fast:** Check out the [benchmarks](https://gist.github.com/patx/1269e389d7d19ea31eb3b9ffff47e0cb#file-micropie_fastapi_benchmarks-md)!
13+
-**Blazing Fast:** Check out how MicroPie compares to other popular ASGI frameworks below!
1414

1515
## **Installing MicroPie**
1616

@@ -171,8 +171,9 @@ ASGI is the future of Python web development, offering:
171171
MicroPie allows you to take full advantage of these benefits while maintaining simplicity and ease of use you're used to with your WSGI apps and it lets you choose what libraries you want to work with instead of forcing our ideas onto you!
172172

173173

174-
## **Feature Comparison**
174+
## **Comparisons**
175175

176+
### **Features vs Other Popular Frameworks*
176177
| Feature | MicroPie | Flask | CherryPy | Bottle | Django | FastAPI |
177178
|---------------------|---------------|--------------|------------|--------------|--------------|-----------------|
178179
| **Ease of Use** | Very Easy | Easy | Easy | Easy | Moderate | Moderate |
@@ -182,7 +183,23 @@ MicroPie allows you to take full advantage of these benefits while maintaining s
182183
| **Async Support** | Yes (ASGI) | No (Quart) | No | No | Limited | Yes (ASGI) |
183184
| **Built-in Server** | No | No | Yes | Yes | Yes | No |
184185

185-
186+
### **Performance vs Other ASGI Frameworks**
187+
| Framework | Threads | Connections | Duration (s) | Requests/sec | Latency (ms) | Transfer/sec (KB) |
188+
|------------|----------:|--------------:|---------------:|---------------:|---------------:|--------------------:|
189+
| FastAPI | 4 | 100 | 30 | 1895.29 | 52.67 | 257.54 |
190+
| MicroPie | 4 | 100 | 30 | 2272.76 | 43.93 | 362.18 |
191+
| Quart | 4 | 100 | 30 | 1500.13 | 66.63 | 212.68 |
192+
| Starlette | 4 | 100 | 30 | 2305.50 | 43.30 | 326.88 |
193+
| FastAPI | 4 | 200 | 30 | 2015.90 | 99.78 | 273.94 |
194+
| MicroPie | 4 | 200 | 30 | 2516.01 | 79.31 | 400.92 |
195+
| Quart | 4 | 200 | 30 | 1574.15 | 126.63 | 223.16 |
196+
| Starlette | 4 | 200 | 30 | 2658.45 | 75.10 | 376.86 |
197+
| FastAPI | 4 | 1000 | 30 | 2129.72 | 463.63 | 289.44 |
198+
| MicroPie | 4 | 1000 | 30 | 2589.64 | 381.86 | 412.79 |
199+
| Quart | 4 | 1000 | 30 | 1557.83 | 628.80 | 221.01 |
200+
| Starlette | 4 | 1000 | 30 | 2887.07 | 342.99 | 409.37 |
201+
202+
*Tests were performed with `uvicorn` using 4 workers. Benchmarked with `wrk`. This a minimal baseline benchmark, and should be taken with a grain of salt.*
186203

187204
## **Suggestions or Feedback?**
188205
We welcome suggestions, bug reports, and pull requests!

examples/hello_world/benchmarks/bench.sh

Lines changed: 0 additions & 56 deletions
This file was deleted.

examples/hello_world/benchmarks/benchmark_results.txt

Lines changed: 0 additions & 53 deletions
This file was deleted.

examples/hello_world/benchmarks/fast.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/hello_world/benchmarks/micro.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/hello_world/benchmarks/qrt.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/hello_world/benchmarks/star.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)