Hacker News new | ask | show | jobs
by est 4694 days ago
Okay, this is yet another weekly HN "Hello world http benchmark on a Macbook Pro" series. I'd bite. The following Python snippet seems much faster than OP's Go code under the same ab testing.

HTTP server: https://github.com/jonashaag/bjoern

    import bjoern, json


    def home_app(environ, start_response):
      start_response('200 OK', [('Content-Type', 'text/plain')])
      s = {'name': 'A Royal Baby', 'body':'A slow news week'}
      yield json.dumps(s)


    bjoern.run(home_app, '127.0.0.1', 8086)