Nav links

Saturday, 17 February 2007

Chaucery gets shinier

The .php pages on chaucery.com are now processed by PHP5 instead of PHP4. This is a beta service offered by my host, but I don't expect that'll lead to any problems. The first PHP5 beta came out in June 2003, but it's good to let software settle down with a few bugfix releases before switching.



My main incentive to update was to be able to use SQLite 3, which offers smaller, faster databases than SQLite 2. My Crossword Tools database has indeed shrunk from 8MB to 5MB, but it seems a trifle slower. I had to rewrite some of the database access code to use PDO instead of SQLite specific calls, and I hope that further tweaking may bring the speed back. (PDO lets you use SQLite 2 as well as SQLite 3. Thus I can use identical code to compare the databases, and I find the SQLite 2 is 3 times faster than SQLite 3. This is certainly not expected, and I shall have to explore further.)



The only other problem with the upgrade was that my Asciifier page went blank. This was relating to the page compression, which was necessary on such a potentially large page. To fix it I replaced:



header('Content-Encoding: gzip');
with
ob_start("ob_gzhandler");

It seems to work okay now.



Update 18 Feb: After some tweaking of the order and composition of the statements in the WHERE clause of my crossword tools SQL code I have got the speed of the SQLite3 database to within cooee of the SQLite2 database. It's now faster than it used to be, so that's a good result.