It just return json document with a few thousand characters (1053 bytes)
$siege -c 400 -t 20s -r 2000 http://localhost:9999/js
Python 2.7.7:
Lifting the server siege... done.
Transactions: 14478 hits
Availability: 100.00 %
Elapsed time: 19.10 secs
Data transferred: 14.54 MB
Response time: 0.01 secs
Transaction rate: 758.01 trans/sec
Throughput: 0.76 MB/sec
Concurrency: 8.91
Successful transactions: 14478
Failed transactions: 0
Longest transaction: 1.08 seconds
Shortest transaction: 0.00
pypy-2.3.1 stable:
Transactions: 15149 hits
Availability: 100.00 %
Elapsed time: 19.63 secs
Data transferred: 15.21 MB
Response time: 0.02 secs
Transaction rate: 771.73 trans/sec
Throughput: 0.77 MB/sec
Concurrency: 11.92
Successful transactions: 15149
Failed transactions: 0
Longest transaction: 1.09 seconds
Shortest transaction: 0.00
pypy--c-jit-73283-912dd9df99a8-linux64 (latest nightly build)
Lifting the server siege... done.
Transactions: 14361 hits
Availability: 100.00 %
Elapsed time: 19.13 secs
Data transferred: 14.42 MB
Response time: 0.03 secs
Transaction rate: 750.71 trans/sec
Throughput: 0.75 MB/sec
Concurrency: 21.53
Successful transactions: 14361
Failed transactions: 0
Longest transaction: 3.03 seconds
Shortest transaction: 0.00
Pypy Nightly have some request Randomly get to 3.0 Seconds , normally
those requests (in Cpython) are only ~0.001 to 0.002 sec.
import tornado.httpserver
import tornado.ioloop
import tornado.web
import json
import os
class IndexHandler(tornado.web.RequestHandler):
def get(self):
self.render("./static/index.html")
class IndexMemHandler(tornado.web.RequestHandler):
def get(self):
self.finish("<html> <body>HELLO WORLD</body></html>")
class JsonHandler(tornado.web.RequestHandler):
def get(self):
self.set_header('Content-Type', 'application/json')
response_str = json.dumps(dict(name=u"v3ss", passw=u"a" * 1024))
self.finish(response_str)
def serve(port=8888, host="0.0.0.0"):
app = tornado.web.Application(
handlers=[
# (r'/chat/post/(\w+)',ChatBox) ,
(r'/', IndexHandler),
(r'/mem', IndexMemHandler),
(r'/js', JsonHandler),
],
static_path=os.path.join(
os.path.dirname(__file__), "static"),
autoReload=True,
debug=True
)
http_server = tornado.httpserver.HTTPServer(app)
http_server.listen(port, host)
tornado.ioloop.IOLoop.instance().start()
if __name__ == '__main__':
serve()
_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev