Add web framework benchmark example (Barq)#317
Add web framework benchmark example (Barq)#317grandimam wants to merge 2 commits intoQuansight-Labs:mainfrom
Conversation
Demonstrates free-threaded Python performance benefits for web frameworks: - Pure Python HTTP framework using ThreadPoolExecutor - 2-5x faster than FastAPI on various workloads - Shows thread scaling with CPU-bound handlers
|
@nascheme would you mind giving this a look, along with barq? You know a lot more about web development than I do. |
|
I think this is a pretty good example of how to use free-threaded Python to build such a thing. The HTTP/1.1 protocol implementation is skeletal, let's say. The readme has an "Experimental" note and that's good. As an example for people to learn from, I think the simpler code is an advantage. I have submitted a PR that updates it to use Python 3.14t. I think it would be a good idea even though I'm not sure how much extra performance that gives. 3.14 has been released for a while now so there should be no problem in using it. |
|
Oh, one additional suggestion for @grandimam, I think this statement in your readme might be misleading:
How have you tested it on real workloads? If you are talking about the scripts inside |
|
For interests sake, here are benchmark results on my 28-core i7-14700K. I'm using 10 barq workers. The difference between 3.13t and 3.14t seems primarily noise, would need more complex benchmark tests to see if one is actually faster. |
Demonstrates free-threaded Python performance benefits for web frameworks: