Discussion:
[KPhotoAlbum] Eliminating unneessary information in index.xml
Robert Krawitz
2017-06-05 01:15:13 UTC
Permalink
There are several pieces of information in index.xml that aren't
really necessary in most cases:

* angle can default to 0 (or why is it needed at all if the file
hasn't been rotated in KPA -- if the file doesn't have EXIF
information and the file hasn't been manually rotated; if it has
EXIF, it could just come from there if it's actually needed for
anything?)

* endDate can default to startDate

* label can default to the base name of the file

This shaves off about 20% of the size from my index.xml (41 MB vs 53
MB) and saves about 1 second (maybe 7%) of startup time.

Obviously, if there's no setting to control this, it will break
forward compatibility (i. e. an older kpa won't be able to correctly
read a newer index.xml). But we're at the point now where it's going
to be hard to get really big improvements. I think we can get
probably 15-20% out of XMLDB::Database::Classify by a combination of
removing 2 of the 3 calls during startup and tuning what's going on in
there.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Robert Krawitz
2017-06-05 12:19:50 UTC
Permalink
I've removed two of the three calls to recount() during startup (and,
I think, one during the ordinary run of code) with no *obvious* ill
effects. Startup time is now down to about 11 seconds, so 3.5-4
seconds off original (using the compressed index.xml).

Someone who's more familiar with what's going on needs to take a look
at this.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Johannes Zarl-Zierl
2017-06-05 20:10:20 UTC
Permalink
Post by Robert Krawitz
Obviously, if there's no setting to control this, it will break
forward compatibility (i. e. an older kpa won't be able to correctly
read a newer index.xml). But we're at the point now where it's going
to be hard to get really big improvements.
I'm going to postpone this patch for a little bit. In case any other changes
to the index.xml format pop up in the meantime, we can bundle them into a
single version bump...

Cheers,
Johannes
Robert Krawitz
2017-06-06 00:52:31 UTC
Permalink
Post by Johannes Zarl-Zierl
Post by Robert Krawitz
Obviously, if there's no setting to control this, it will break
forward compatibility (i. e. an older kpa won't be able to correctly
read a newer index.xml). But we're at the point now where it's going
to be hard to get really big improvements.
I'm going to postpone this patch for a little bit. In case any other
changes to the index.xml format pop up in the meantime, we can
bundle them into a single version bump...
That makes sense.

Perhaps we can think about how to eliminate the angle and dimensions,
at least for images with EXIF data, where those could be populated on
the fly if/when needed (or in most cases, probably just done as a DB
query). Those shrink my (compressed format) index.xml from 41 MB to
35 MB (from the original 53 MB). I haven't measured the impact on
startup time; I'd SWAG that it will be around 5%.
--
Robert Krawitz <***@alum.mit.edu>

*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Loading...