squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.61k stars 581 forks source link

Sanic benchmark code runs in debug mode with full access log #140

Closed gatopeich closed 5 years ago

gatopeich commented 5 years ago

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

squeaky-pl commented 5 years ago

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.

squeaky-pl commented 5 years ago

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

gatopeich commented 5 years ago

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).