Revision 8e78425...

Go back to digest for 5th May 2013

Optimization in KDE-PIM

Milian Wolff committed changes in [kdepimlibs] /:

Save memory by sharing data object of empty KABC::Picture objects

Optimize memory consumption of KABC library for large address books.
In many cases no picture will be set for a contact yet still
Picture::Private was allocated. On my 64bit machine it has a size of
64bytes.

A common practice is to share the data member for empty objects, as is
done in most Qt classes (QString e.g.). This then saves the
Picture::Private allocation for all contacts which do not have any
picture set.

Implementation detail: Sadly one cannot make it work with a private
Private class as that would not be accessible by the Q_GLOBAL_STATIC
helper. Renaming the private data class should not have any affect
on the ABI though.

REVIEW: 110300

File Changes

Modified 2 files
  •   kabc/picture.cpp
  •   kabc/picture.h
2 files changed in total