[Patch] Efficient ByteVector::replace() implementation

Lukáš Lalinský lalinsky at gmail.com
Thu Sep 17 09:21:09 CEST 2009


On Thu, Sep 17, 2009 at 8:34 AM, Wladimir Palant
<palant at songbirdnest.com> wrote:
> I noticed that TagLib will perform exceptionally badly on some occasions.
> One extreme example that I've been looking at was an MP3 file with an album
> image in BMP format - 7 MB. Extracting that image via TagLib took definitely
> more than 10 minutes, I didn't have the patience to wait for it to be done.
> All the time was being spent in ByteVector::replace() method which performs
> poorly. Here is a patch for that method:
> http://bugzilla.songbirdnest.com/attachment.cgi?id=12077&action=diff
> (http://bugzilla.songbirdnest.com/attachment.cgi?id=12077&action=diff&format=raw
> for the raw patch). The new algorithm never resizes the vector more than
> once, it also doesn't perform any unnecessary move operations. The file in
> question is processed in less than a second.

Any chance I could convince you to write unit tests for the new code
paths in ByteVector::replace()?

-- 
Lukas Lalinsky
lalinsky at gmail.com


More information about the taglib-devel mailing list