ZeroIntensity / view.py

The Batteries-Detachable Web Framework
https://view.zintensity.dev
MIT License
206 stars 15 forks source link

Route logging is extremely slow #191

Open ZeroIntensity opened 1 week ago

ZeroIntensity commented 1 week ago

Description:

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:

ZeroIntensity commented 1 week ago

I'll probably have to put together a library for asynchronous and fast logging, with a C API detached from the GIL.