KFilterDev changes from KDE3

Thiago Macieira thiago at kde.org
Wed Mar 18 07:34:45 GMT 2009

Martin Koller wrote:
>On Tuesday 17 March 2009, David Faure wrote:
>> > Well, I know the mimetype, but as I do a backup of a _lot_ of files,
>> > isn't the overhead too high to again and again calling
>> > findFilterByMimeType() (as the mimetype will never change during the
>> > complete backup) ?
>> KFilterBase::findFilterByMimeType only loads a mimetype from ksycoca
>> (that's supposed to be really fast, just a dict lookup and a bit of
>> deserialization) and compares strings. If it really turns out to be a
>> bottleneck, we could add a cache in KFilterDev so that it remembers
>> the last requested mimetype and the KFilterBase that was created for
>> it (with care not to leak or double-delete kfilterbases...). In any
>> case this can and should be handled internally in KFilterDev.
>I now run a first test:
>~18000 files processed: KDE4 3:02 Minutes, KDE3 2:12 Minutes ...
>It _is_ a bottleneck, as this was just a small test.

Then I guess you can run callgrind and find out what the hot paths are. 
That's where you should optimise.

  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090318/300b8cb2/attachment.sig>

More information about the kde-core-devel mailing list