Archive for the ‘Python’ Category

Useful Python Resources for Setting Up Django Website

September 9, 2010 Leave a comment

Recently, I am developing a website and need practical solution to setting up a real-life production web serving environment.

I googled and found following links that are useful for my final decision.

Application Servers: Benchmark of Python Web Servers
Cache Mechanisms: Evaluating Django Caching Options

Other resources can be found also from the links contained in above articles.

Yet, I haven’t decide which app server and cache will be used, but obviously, nginx(uwsgi) + gevent powered app server + staticgenerator or django built-in cache middleware or varnish would be the most possible choose.

Categories: Python Tags: , ,

Simple benchmark between Cython and Boost.Python

February 28, 2010 1 comment

Inspired by Dan Sanduleac’s post at, I re-ran the benchmark between Cython and Boost.Python.

Basically, Cython is about 7x times faster than Boost.Python, which astonished me.

The benchmark was run at my 13 inch MacBook Pro, with OSX leopard. The softwares I used were all installed with MacPorts:

  • boost: 1.42.0 (with +python26 enabled)
  • Cython: 0.12
  • Python 2.6
  • cmake 2.8

I used cmake instead of boost-bjam, which is the recommended build tools for boost.python. I don’t think it would affect the result. When compiling, I had -O3 turned on.

As I said, the benchmark was initially carried out by Dan Sanduleac, but I thought his implementation had some problem, he used directly cython to do arithmetic operation, not the native c++. For fair comparison, we should use Cython and Boost.Python in the same way – binding the C++ python which implemented calculation logic, so that we measure the overhead of binding code much more precisely.


Get every new post delivered to your Inbox.