[Okular-devel] md5 hash for annotation file name

Albert Astals Cid aacid at kde.org
Thu Sep 18 22:53:38 CEST 2008


A Dijous 18 Setembre 2008, Pino Toscano va escriure:
> Alle giovedì 11 settembre 2008, Markus Grabner ha scritto:
> > Loading the file from a local hard disk takes considerably longer,
>
> You are assuming whatever will load a document, will load it at once, while
> there are file formats that can be read by chunk (eg TIFF, PostScript).
>
> > so I'm
> > not very much concerned about the hash computation time. However, the
> > "readAll()" definitely has to be replaced by reading smaller chunks and
> > processing them sequentially, that was just for the "proof of concept".
>
> Reading the whole document by chunks or once at a single shot is basically
> the same.

Not really, reading the document as a whole gives you a QByteArray of the full 
size of the file, if you read 1MB at a time, you have much less peak memory 
usage, so you don't get out of physical memory and are potentially much 
faster.

Albert

>
> > > so reading up to 1MB as much would be much better imho.
> >
> > If an annotation refers to a typo on the last page of a huge document,
> > and this gets fixed, the same annotation would still be displayed for the
> > corrected file if the correction appears after the portion of the file
> > for which the hash value is computed (at least for uncompressed formats
> > such as PostScript).
>
> Or, more than that, two documents could be the very same up to some size.




More information about the Okular-devel mailing list