Shared empty private class for KTimeZoneBackend

Review Request #101593 - Created June 12, 2011 and submitted

Information
Volker Krause
kdelibs
master
Reviewers
kdelibs
djarvie, jlayt
This patch makes KTimeZoneBackend use a shared empty private class, an optimization done in a few other places around KDateTime already.

This specific place turned up during memory-profiling KMail with folders containing ~100k messages. KMail (via KMime) creates one KDateTime object per message (using OffsetFromUTC mode), each of which contains two (empty) KTimeZone objects. The resulting 200k (identical) KTimeZoneBackend objects use about 20Mb of heap memory according to massif.
kdecore unit tests still pass, KMail also still works fine, but I have no idea if this has side-effects on other, more complex use-cases
Michael Pyne
Volker Krause
Review request changed

Change Summary:

Fix the assert found by Michael as suggested by David.

Diff:

Revision 2 (+8 -3)

Show changes

David Jarvie
Looks good.
kdecore/date/ktimezone.cpp (Diff revision 2)
 
 
 
Indentation should be 4
Loading...