Sanic benchmark code runs in debug mode with full access log
gatopeich opened this issue · comments
No wonder your Sanic example runs so slow!
You should at least run it like this:
app.run(debug=False, access_log=False)`
See https://sanic.readthedocs.io/en/latest/sanic/logging.html
Invalid. If you checked requirements file here https://github.com/squeaky-pl/japronto/blob/master/benchmarks/sanic/requirements.txt you would see that it was version 0.2.0.
Now in 0.2.0 https://github.com/huge-success/sanic/blob/0.2.0/sanic/sanic.py#L247 debug=False
was the default and also logging was disabled by default. https://github.com/huge-success/sanic/blob/0.2.0/sanic/sanic.py#L315
Since then Sanic got only slower.
If you want more up to date verison of sanic compared (0.8) look here:
https://github.com/the-benchmarker/web-frameworks#full-table-1
Thanks for the link, though those benchmarks are for code that does nothing with the data.
I have my own benchmarks which parse POSTed JSON and build a response which depends on the input. There is also a fixed time async i/o operation cause it matters for my use case.
In my benchmark, I get about ~35 kRPS with Japronto+ujson, vs ~18 kRPS with Sanic.
I have tested many frameworks before and Sanic was the best so far in async mode, with gunicorn/Meinheld topping in sync mode (no asyncio operation).