[Digikam-devel] Re: file hash creation: asking for short test

Marcel Wiesweg marcel.wiesweg at gmx.de
Thu Dec 9 15:17:53 GMT 2010



> Also, I might understand it wrong, but wouldn't reading the beginning be
> better than reading the end of file in regards to IO operations? (as with
> reading the end of the file you must move the file "cursor" to somewhere
> near the end, with the beginning you just open and read)

I did a small benchmark reading 8 or 100 kb from the beginning, middle and/or 
end of a file:
    8 - -: 8.5 ms
    100 - -: 15.2 ms
    100 - 8 - 100: 32.2 ms
    100 - - 8: 22.0 ms
    100 - - 100: 24.5 ms
so there is a cost for linear reading (reading 8 kb is faster than reading 100 
kb) and there is a cost for each seek operation (reading 100 kB is by far not 
10 times slower than reading 8 kb, so there is a large constant amount).

The numbers are not overly accurate. With larger scale scanning - my whole 
collection - I needed only 15ms/file for the "100 - - 100" approach, in the 
benchmark it was 24. Dont know why.

Marcel



More information about the Digikam-devel mailing list