tag:blogger.com,1999:blog-8404509726009905633.post7011164775159907421..comments2023-10-09T14:15:54.979+03:00Comments on Mind Reference: Python Templates BenchmarkAndriy Kornatskyyhttp://www.blogger.com/profile/04890869628175359888noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-8404509726009905633.post-29296157394899654372013-11-30T22:59:45.082+02:002013-11-30T22:59:45.082+02:00The first use of template is compilation (warm up ...The first use of template is compilation (warm up in benchmark), the result (compiled template) is reused whenever after.Andriy Kornatskyyhttps://www.blogger.com/profile/04890869628175359888noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-8477687458486663232013-11-30T22:32:29.749+02:002013-11-30T22:32:29.749+02:00From a quick look to source code I do not see that...From a quick look to source code I do not see that you use https://github.com/MiCHiLU/jinja2-precompiler - it should give some serious speed up.ASTerushttps://www.blogger.com/profile/05134056337196575983noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-49473292511050209872013-11-30T22:17:23.035+02:002013-11-30T22:17:23.035+02:00The tests do no reflect compilation part. Consider...The tests do no reflect compilation part. Consider take a look at benchmarks source code.Andriy Kornatskyyhttps://www.blogger.com/profile/04890869628175359888noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-59011035762814639372013-11-30T21:55:01.650+02:002013-11-30T21:55:01.650+02:00Regards Jinja - is it Jinja2 without templates com...Regards Jinja - is it Jinja2 without templates compilation to python code?<br /><br />As far as I know if you compile templates to .py it runs amazingly fast. Probably your tests reflect just compilation part and not the render itself.ASTerushttps://www.blogger.com/profile/05134056337196575983noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-84256052387564618932012-12-24T11:55:39.347+02:002012-12-24T11:55:39.347+02:00I have updated post with tenjin in the list now.I have updated post with tenjin in the list now.Andriy Kornatskyyhttps://www.blogger.com/profile/04890869628175359888noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-53973705648891096352012-12-22T15:23:15.220+02:002012-12-22T15:23:15.220+02:00Nice article! It would be interesting if Tenjin we...Nice article! It would be interesting if Tenjin were included in it.Patchworkhttps://www.blogger.com/profile/05358665841615288641noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-43632029187714482562012-12-12T20:05:32.619+02:002012-12-12T20:05:32.619+02:00I always get annoyed by these "how relevant a...I always get annoyed by these "how relevant are your benchmarks on an application?" / "Use a cache". Well, template rendering IS a part of an application, and it's easier and more wise to benchmark isolated parts then the whole. Everyone knows what caching can do for a web application and that a web application is not just templating. He's not claiming application for Steve Howehttps://www.blogger.com/profile/03561736509591332880noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-86664186657247082782012-10-24T09:39:07.721+03:002012-10-24T09:39:07.721+03:00I would suggest take a look at C10K topic. The que...I would suggest take a look at C10K topic. The question is about efficiency.Andriy Kornatskyyhttps://www.blogger.com/profile/04890869628175359888noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-8545236577310182322012-10-24T03:04:39.716+03:002012-10-24T03:04:39.716+03:00I think when cached values are kilobytes in size t...I think when cached values are kilobytes in size then even memcached give >1ms latencies. Also a single uncached HDD access means at least 8-10ms latency (not necesserily SQL access, can be eg. logging). I would say that 50ms for computing server response for a real world website is very fast. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-5641572791300289062012-10-23T21:34:02.243+03:002012-10-23T21:34:02.243+03:00I believe this is how it used, actually. See the s...I believe this is how it used, actually. See the source:<br />https://bitbucket.org/akorn/helloworld/src/tip/05-template/django/app.pyAndriy Kornatskyyhttps://www.blogger.com/profile/04890869628175359888noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-33705343104770745222012-10-23T21:28:28.060+03:002012-10-23T21:28:28.060+03:00Why not put cache between web application and data...Why not put cache between web application and database? That changes use case dramatically. Don't you think?Andriy Kornatskyyhttps://www.blogger.com/profile/04890869628175359888noreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-60962717639502295682012-10-23T21:22:57.971+03:002012-10-23T21:22:57.971+03:00Thank you for the nice benchmark, especially for h...Thank you for the nice benchmark, especially for handing out the source. It would be interesting to see how django templates perform if you activate the cached template loader (I assume it will be considerably faster):<br /><br />TEMPLATE_LOADERS = (<br /> ('django.template.loaders.cached.Loader', (<br /> 'django.template.loaders.filesystem.Loader',<br /> 'Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8404509726009905633.post-90163384116699172732012-10-23T19:29:41.304+03:002012-10-23T19:29:41.304+03:00I followed your series of web components benchmark...I followed your series of web components benchmarks but I'm not sure how relevant they are to the "real world". If you take the slowest template engine in the slowest test it is 596 RPS = about 2ms per request. And for a fast website using SQL it takes let's say 50ms (probably more) to render complete HTML response, with majority of time spent waiting for SQL server and logging Anonymousnoreply@blogger.com