Django ORM performance patch

February 14, 2008

I made a patch for Django to add QuerySet.fields(*fields, **related_fields) and make possible to load only some from master and related models fields. It allows to tune various object list queries when we need only limited subset of all fields, improve general performance and decrease database load. As side effect of this patch support of selecting fields from related models in QuerySet.values() is implemented too. It was changed signature of this method from values(*fields) to values(*fields, **related_fields) but the change is backward compatible.

WebAlchemy vs StaticGenerator

January 09, 2008

When two months ago I published WebAlchemy code, several people asked me how to make it working with nginx or lighttpd. Yesterday new tool similar to WebAlchemy StaticGenerator was published. Now it seems right time to explain how to use WebAlchemy with nginx and other servers that don't have .htaccess files, highlight some important differences between WebAlchemy and StaticGenerator, and say thanks to Django for signal framework that makes it all possible.

Ruby 1.9 doesn't smoke Python away!

November 28, 2007

Antonio Cangiano compared execution time of recursive Fibonacci function written in Python and Ruby 1.9 and found that Ruby variant was almost 3 times as fast. It allowed him to write blog entry titled "Holy Shmoly, Ruby 1.9 smokes Python away!". It's time to show secret Python weapon – calculation of same Fibonacci numbers but in 1000 times faster than Antonio's Ruby implementation.

WebAlchemy accelerates Django in 100 times

November 18, 2007

With WebAlchemy only pages involved in form processing are served directly by Django, the rest of the pages most of the time are served directly by Apache as static content with static content speed. In other words for Django-powered site it's possible to achieve speed about 2000 request/sec, against about 500 request/sec with memcached and about 20 request/sec for "typical" (10 fast SQL queries) page without caching at all. Actual performance results of course will vary from server/application/configuration.

Django profiler

November 10, 2007

django-profile.py allows to analyze any django projects, i.e. to find number of SQL queries used on each page and print common SQL-usage report.