Bug#758487: findimagedupes: speed improvements

Jonathan H N Chin code at jhnc.org
Wed Jan 23 18:27:51 GMT 2019


Thank you for the suggested patch which, unfortunately, I have
only just seen.

Benchmarking the change on a buster/sid system today with:

    findimagedupes_2.18-7
    libgraphics-magick-perl_1.4~hg15873-1+b1

    perl -dNYTProf ./findimagedupes-test -v fp -n -- ...

I get:

    Calls P F Exclusive Inclusive Subroutine

with modulate:

    665   1 1  119s   119s   Graphics::Magick::Read (xsub)
    1330  2 1  2.79s  2.79s  Graphics::Magick::Sample (xsub)
    665   1 1  2.12s  2.12s  Graphics::Magick::Equalize (xsub)
    665   1 1  1.48s  1.48s  Graphics::Magick::Blur (xsub)
    665   1 1  1.47s  1.47s  Graphics::Magick::Normalize (xsub)
    665   1 1  1.38s  1.38s  Graphics::Magick::Modulate (xsub)

with quantize:

    665   1 1  135s   135s   Graphics::Magick::Read (xsub)
    665   1 1  9.79s  9.79s  Graphics::Magick::Quantize (xsub)
    1330  2 1  3.02s  3.02s  Graphics::Magick::Sample (xsub)
    665   1 1  2.46s  2.46s  Graphics::Magick::Equalize (xsub)
    665   1 1  1.60s  1.60s  Graphics::Magick::Blur (xsub)
    665   1 1  1.45s  1.45s  Graphics::Magick::Normalize (xsub)


Lots of jitter, but time is dominated by Graphics::Magick::Read
and it seems modulate is now significantly faster than quantize.

Generally, I would expect tweaking the algorithm like this to have
minimal effect given that after the initial resampling, everything
operates on tiny images and not the potentially-huge originals.



-jonathan



More information about the debian-science-maintainers mailing list