TagLib::String::null considered harmful
pdh at utter.chaos.org.uk
Fri Mar 7 18:05:50 CET 2008
On Fri, 2008-03-07 at 09:48 -0500, Jeff Mitchell wrote:
> Peter Hartley wrote:
> > [Multithreading]
> Peter, are you sure this would actually be faster? Disk/network I/O is
> typically the bottleneck, which won't be helped just by multithreading
Yes, I benchmarked it. Following an "echo 3 > /proc/sys/vm/drop_caches"
each time, a scan of a large corpus of FLAC files takes 818s elapsed
single-threaded, 788s elapsed with 2 threads, 730s elapsed with 16, and
687s elapsed with 64 -- that's 16%, or over two minutes, quicker. This
is on a relatively feeble CPU (600MHz VIA C3) with single local UDMA/133
disk, Linux 2.6.24.
What I suspect is going on, is that the workload is completely
seek-bound. (Even with 64 threads going, the CPU spends >90% of its time
in disk wait.) Having 64 outstanding requests at any one time probably
lets the elevator sorting do its job and cause the average seek to be
shorter, and therefore quicker. A SATA and/or RAID system would probably
see even larger speed-ups.
More information about the taglib-devel