view.py's route logging system through route_log in the C API is extremely slow. Basically, with the new PyAwaitable vendor on the reactpy branch, view.py is slower than pretty much all other web frameworks with route logging enabled.
With route logging disabled, it becomes several times faster, and outperforms every Python ASGI framework (that I've tried, at least). I tested FastAPI, BlackSheep, and Emmett, and view.py beat all of them with it's route logger disabled.
So, what's the fix? Well, we could just leave route logging out, but that's going to remove some debugging ability for the user, so there's three main options here:
Only enable route logging during development mode.
Optimize the route logging implementation (either write it in C, or compile it with Cython or something)
Perform route logging in it's own thread, using only C file streams. This would remove interop with Python, so we'd have to add some settings.
Description:
view.py's route logging system through
route_log
in the C API is extremely slow. Basically, with the new PyAwaitable vendor on thereactpy
branch, view.py is slower than pretty much all other web frameworks with route logging enabled.With route logging disabled, it becomes several times faster, and outperforms every Python ASGI framework (that I've tried, at least). I tested FastAPI, BlackSheep, and Emmett, and view.py beat all of them with it's route logger disabled.
So, what's the fix? Well, we could just leave route logging out, but that's going to remove some debugging ability for the user, so there's three main options here: