Code Monkey home page Code Monkey logo

tornado-templates-benchmark's Introduction

Template engines benchmark

To run Tornado server:

python server.py --autoescape=(0|1)

To run benchmark i used:

ab -n 10000 -c 1 'http://localhost:8888/tornado/' 

to test Tornado templates or for Jinja2:

ab -n 10000 -c 1 'http://localhost:8888/jinja/'

Jinja

Without autoescape

* Empty template:
	Render time (avg): 0.0093 ms
	Full render time (avg): 0.0494 ms

* Normal tempalate:
	Render time (avg): 0.0106 ms
	Full render time (avg): 1.4693 ms

Autoescape on

* Empty template:
	Render time (avg): 0.0092 ms
	Full render time (avg): 0.0502 ms

* Normal tempalate:
	Render time (avg): 0.0095 ms
	Full render time (avg): 3.4678 ms

Tornado

Without autoescape

* Empty template
	Render time (avg): 0.0203 ms
	Full render time (avg): 0.0684 ms

* Normal tempalte
	Render time (avg): 1.2098 ms
	Full render time (avg): 1.2620 ms

Autoescape on:

* Empty template:
	Render time (avg): 0.0242 ms
	Full render time (avg): 0.0786 ms

* Normal template:
	Render time (avg): 2.3724 ms
	Full render time (avg): 2.4286 ms

tornado-templates-benchmark's People

Contributors

spoof avatar

Stargazers

 avatar

Watchers

 avatar

tornado-templates-benchmark's Issues

Missed translations dir

Please, make a higher level director translations, due to it is necessary to run a server.

Tornado handlers error

% ./wrk -t10 -c10 -r10000 http://127.0.0.1:8888/tornado/

ERROR:root:Uncaught exception GET /tornado/ (127.0.0.1)
HTTPRequest(protocol='http', host='127.0.0.1:8888', method='GET', uri='/tornado/', version='HTTP/1.1', remote_ip='127.0.0.1', body='', headers={'Host': '127.0.0.1:8888'})
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 1042, in _execute
    getattr(self, self.request.method.lower())(*args, **kwargs)
  File "server.py", line 82, in get
    self.render("index.html", **context)
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 582, in render
    self.finish(html)
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 722, in finish
    self.request.finish()
  File "/Library/Python/2.7/site-packages/tornado/httpserver.py", line 422, in finish
    self.connection.finish()
  File "/Library/Python/2.7/site-packages/tornado/httpserver.py", line 193, in finish
    self._finish_request()
  File "/Library/Python/2.7/site-packages/tornado/httpserver.py", line 229, in _finish_request
    self.stream.read_until(b("\r\n\r\n"), self._header_callback)
  File "/Library/Python/2.7/site-packages/tornado/iostream.py", line 153, in read_until
    self._try_inline_read()
  File "/Library/Python/2.7/site-packages/tornado/iostream.py", line 388, in _try_inline_read
    self._check_closed()
  File "/Library/Python/2.7/site-packages/tornado/iostream.py", line 571, in _check_closed
    raise IOError("Stream is closed")
IOError: Stream is closed
ERROR:root:Cannot send error response after headers written
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/tornado/iostream.py", line 311, in wrapper
    callback(*args)
  File "/Library/Python/2.7/site-packages/tornado/httpserver.py", line 268, in _on_headers
    self.request_callback(self._request)
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 1427, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 1046, in _execute
    self._handle_request_exception(e)
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 1086, in _handle_request_exception
    self.send_error(500, exc_info=sys.exc_info())
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 741, in send_error
    self.finish()
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 721, in finish
    self.flush(include_footers=True)
  File "/Library/Python/2.7/site-packages/tornado/web.py", line 681, in flush
    self.request.write(headers + chunk, callback=callback)
  File "/Library/Python/2.7/site-packages/tornado/httpserver.py", line 418, in write
    self.connection.write(chunk, callback=callback)
  File "/Library/Python/2.7/site-packages/tornado/httpserver.py", line 183, in write
    assert self._request, "Request closed"
AssertionError: Request closed
ERROR:root:Exception in callback <tornado.stack_context._StackContextWrapper object at 0x10bf32940>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.