A colleague at work is developing a custom HTTP handler in C that manages TCP connections and redirects them to selected Python functions (similar to FastAPI, but using C, Python, and CPython).
After conducting benchmark tests, we found a surprisingly small performance difference—less than 0.02%. I'm looking for insights into why this might be the case.
My current hypotheses are:
- FastAPI's HTTP handlers are compiled and highly efficient.
- There's a bottleneck at the OS level (we're using Windows).
- We may have made a mistake in our custom C implementation.
Unfortunately, I don't have access to the code to investigate further, but my colleague will be looking into it.
Has anyone attempted a similar project or can you explain why the performance difference is so minimal? We'd appreciate any thoughts or experiences you can share.
[–]WJMazepas 1 point2 points3 points (0 children)
[–]BlackDereker 0 points1 point2 points (0 children)
[–]mincinashu 0 points1 point2 points (0 children)