[CDBI] Make name_lc go fast

Michael G Schwern schwern at pobox.com
Tue Apr 3 12:38:35 BST 2007

Brad Bowman wrote:
> I timed the commands separately and found a small ~5% improvement
> without the name_lc so I can't explain the Elapsed Times above.
> Any hints?

Since you're timing with real (aka wallclock) time it will be highly dependent
on how loaded your CPU, disks, network, etc... are and whether the things
you're reading from disk are already cached.  If some other process or server
decided to do something while you were running your benchmark that would throw
it off.  If there's any dialogs or other user interaction the time you spend
entering them also becomes a factor.

In short, unless you're running on an unloaded machine in single user mode
you're going to get variable results with wallclock timing.  The best thing to
do is shut down all the other processes you can and run your benchmarks many
times, randomly choosing between the two styles, then average the results.

More information about the ClassDBI mailing list