What does HackerNews think of japronto?

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Language: C

100x faster than FastAPI seems easy. I wonder how it compares to other fast Python libraries like Japronto[1] and non-Python ones too.

1 - https://github.com/squeaky-pl/japronto

I've shared this list here before, and I might need to update it, but here it is again, FWIW:

    New kids on the block:
    - Starlette https://www.starlette.io (function and class based routing)
    - Vibora https://vibora.io (function based routing, no classes)
    - Xweb https://github.com/gaojiuli/xweb (unusual routing system, should be possible to adapt to classes)
    - Storm https://github.com/jiajunhuang/storm (similar enough to Tornado, has classes, but installation is complex)
    - Responder http://python-responder.org (function-based, has classes only as code-grouping mechanism)
    - Quart https://pgjones.gitlab.io/quart/
    - Sanic https://sanic.readthedocs.io
    - Bocadillo https://bocadilloproject.github.io/
    - Japronto https://github.com/squeaky-pl/japronto

    The old guard:
    - Flask http://flask.pocoo.org
    - Tornado http://www.tornadoweb.org
    - Falcon https://falconframework.org/
    - Bottle https://bottlepy.org
    - Pyramid https://trypyramid.com/
    - CherryPy https://cherrypy.org/

    Less known older ones:
    - Wheezy Web https://pythonhosted.org/wheezy.web/
    - API Hour https://pythonhosted.org/api_hour/
    - Morepath https://morepath.readthedocs.io/en/latest/toc.html [WSGI]
    - Klein https://github.com/twisted/klein
    - Weppy http://weppy.org/
This is a short list I have compiled a few months ago, FWIW:

    New kids on the block:
    - Starlette https://www.starlette.io
    - Vibora https://vibora.io
    - Xweb https://github.com/gaojiuli/xweb
    - Storm https://github.com/jiajunhuang/storm
    - Responder http://python-responder.org
    - Quart https://pgjones.gitlab.io/quart/
    - Sanic https://sanic.readthedocs.io
    - Bocadillo https://bocadilloproject.github.io/
    - Japronto https://github.com/squeaky-pl/japronto

    The old guard:
    - Flask http://flask.pocoo.org
    - Tornado http://www.tornadoweb.org
    - Falcon https://falconframework.org/
    - Bottle https://bottlepy.org
    - Pyramid https://trypyramid.com/
    - CherryPy https://cherrypy.org/

    Less known older ones:
    - Wheezy Web https://pythonhosted.org/wheezy.web/
    - API Hour https://pythonhosted.org/api_hour/
    - Morepath https://morepath.readthedocs.io/en/latest/toc.html
    - Klein https://github.com/twisted/klein
    - Weppy http://weppy.org/
Ah I see. I still think if you're measuring that way, there's no reason languages like Python et al. can't accomplish similar too. And if they can't, well, there's always adding more machines. Horizontal scaling tends to occur no matter what you're using, so is the argument just that with less productive (probably a matter of taste for many at this point) languages you'll have to scale out later? That's a tradeoff to consider, but there are other tradeoffs too.

https://www.techempower.com/benchmarks/#section=data-r14&hw=... has some interesting benchmarks, apparently we should be using Dart or C++. Go does slightly better than JS but not a lot. Some newer Python frameworks aren't on there yet. None of them reach near 50k, but I don't know the details of the benchmark and they aren't all using the same DB. Certainly you can get crazy numbers depending on what you're testing. e.g. https://github.com/squeaky-pl/japronto gets one million requests per second through async and pipelining but those requests aren't doing much.

>What's being tested is the presence of pipelining :D

Which is silly considering a majority of wild browsers now support HTTP/2.

Thanks for pointing our the repo, I missed it before: https://github.com/squeaky-pl/japronto

His Go isn't horrible, but it could be written like this:

  func hello(respWtr http.ResponseWriter, req *http.Request) {
    text, status := []byte("Hello world!"), http.StatusOK
    if request.URL.Path != "/" {
      text, status = []byte("Not Found"), http.StatusNotFound
    }
    respWtr.WriteHeader(status)
    response.Write(text)
  }
Rather than: https://github.com/squeaky-pl/japronto/blob/master/benchmark...

Also, limiting Go to use a single core is unfair because the Go GC is optimized for multi-core operation.