SQLObject to hand-crafted SQL

Although I’ve absolutely loved working with SQLObject I’m afraid that the time has come to switch to hand-crafted SQL.

On some of my browse pages I’ve now managed to move from 420 ms to 160 ms by using the Python DBI directly. For the vast majority of applications a 260 ms speed up would not make any difference but for Fab Swingers it is absolutely essential. In fact, 160 ms is still not really fast enough for me but it’s another good step in the right direction.

In addition I’ve switched from accessing MySQL via the network to accessing through the Unix socket (mysql.sock). I’ve not been able to measure a significant improvement but looking at the MySQL Performance Blog it does seem to be a good idea and just from a common-sense point of view it makes sense to go directly to the database without going through the network interface.

3 Responses to “SQLObject to hand-crafted SQL”

  1. skx Says:

    I’m not sure if you’ve previously covered it, but if you’ve not noticed it already I would highly recommend Danga’s memcached.

    I’ve been using it upon a lot of sites for caching things in memory, and if you get a cache hit you’ll see a much faster speedup than relying upon SQL - even hand-crafted.

    http://danga.com/memcached/

  2. fabulous Says:

    I’d missed memcached - it looks really good. Thanks for the tip.

  3. skx Says:

    No worries.

    I notice from re-looking at the site that the Python API seems a little hit and miss, but most of my sites are Perl based and it works nicely for those.

    Steve

    http://ctrl-alt-date.com/

Leave a Reply

You must be logged in to post a comment.