user warning: Duplicate entry '827686' for key 1
query: INSERT INTO dr_accesslog (title, path, url, hostname, uid, sid, timer, timestamp) values('Becoming an Environmentalist', 'node/107', '', '38.107.191.86', 0, '6embtud40on8btpkpfo7jdofd4', 251, 1268788557) in /usr/local/apache/htdocs/includes/database.mysql.inc on line 172.
I've written before about achieving a 300x performance improvement. While that sounds impressive, it was effectively in a lab situation, so it doesn't really count. But now I've done even better than that, and in this case, it was a real-world improvement.
A couple of days ago, I blogged about CPU performance counters (aka CPC's) and the Solaris tools cpustat(1M) and cputrack(1M). That post was actually a prelude to this post. Jon Haslam has recently putback the code for the DTrace cpc provider.
Modern CPUs provide performance counters that let you look at certain aspects of the performance of the system. For example, CPUs generally give you counters to track the number of instructions executed and the number of elapsed clock cycles. Given these two, you can calculate the CPI for an application – the number of cycles per instruction. Ideally, this ratio is very small, with one or even less than one being very good. This means that the application is being as efficient as possible, getting the most work done as quickly as possible.
I remember first running across SIGBUS in an introductory programming course some years ago. You'll get a SIGBUS when you have a misaligned memory access. For example, if you're on a 32-bit processor, an integer is going to be 4-byte aligned, i.e., the address to access that integer will be evenly divisible by 4.