Showing posts from November, 2010

PHP 5.3 Xcache Custom Session Handler

Xcache is a PHP opcode and variable memory cacher. That is, it caches the PHP script code itself to save execution time by not having to re-parse and re-interpret the script every time a page is requested.

Xcache also lets you store PHP variables in the memory cache, and these variables will persist between page requests (and sessions). This is similar to say Java which has an application scope, where you can define a static Hashmap that's available from any request and doesn't get destroyed when a request ends.

This is useful for storing data-structures that are otherwise expensive to build on every request, but I won't get into that here.

You can also use Xcache to take over from the default PHP file-handling session manager. There are two advantages in doing this:

Potentially faster as Xcache stores variables in memory and doesn't need file I/O.Potentially faster as the default file-handling mechanism means one user cannot make concurrent requests to the server in th…

Sonic 4 Physics Fail and Sonic Fan Remix

Those who grew up Sonic on the Genesis/MasterSystem have been holding out for a new release that stayed true to the original formula for over 15 years. Sonic and Knuckles, released in 1994, was the last of the true sonic games. After that Sega started changing all the mechanics and characteristics of the game, and released over a dozen variants on different consoles that were all ultimately failures (at least in the eyes of the classic fans).

Sonic 4 was supposed to be the reboot to the franchise. Sega promised to go back to basics by stripping out all the new characters, the silly story lines, the weird 3D stages, etc. Ageing fans all over the internet were praying that this would finally be a worthy successor to their childhood memories.

The game has now been released for over a month to mixed reviews. Some are happy with the back-to-basics gameplay, others are not. The most common complaints are reuse of old bosses and short play-through (only 4 stages). I'd be able to put up w…

External HDD and USB Flash Benchmarking

I've posted a few articles about the slow write speeds of typical USB 2.0 flash sticks. I used the ATTO Disk Benchmark tool to measure the read/write speed of a few drives I had on hand. Results are below.

SanDisk Cruzer 16GB USB 2.0 Flash Stick
Starting off with the slowest of them all, a newly purchased 16GB SanDisk Cruzer. This stick averaged around 9MB/s write speed, and only 20MB/s read speed. I tried running a VM from it initially, it was dreadfully slow.

Generic 4GB USB 2.0 Flash Stick
Second, I tried a 4GB USB 2.0 pendrive that I've had for a few years now. This thing has no branding on it, but it managed to score much better than my new SanDisk above. Average write speed of around 12MB/s and read speed of 34MB/s.

Transcend StoreJet USB 2.0 5400rpm HDD
Next is my 320GB StoreJet external portable USB HDD that I use on a daily basis to run my virtual-machines from.

This averages 27MB/s write and 34MB/s read. The write speed is twice faster than the generic 4GB USB stick from…