[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: for kmail people: a discussion of mail summary files
From:       Don Sanders <don () sanders ! org>
Date:       2000-05-16 5:08:01
[Download RAW message or body]

> Something that takes up a lot of time in KMail when showing a
> list of message headers (if not taiking up the most time) is the cost of
> operator new.

I've never managed to communicate this problem to anyone else before so maybe I
should spend some extra time to try to make this clear. When creating a large
number of objects The cost (timewise) of allocating memory for an object and
calling its constructor is often relatively large.

I tried to reduce this cost in KMail by reusing existing objects. In technical
literature (Design Patterns by the Gang of Four) this technique is know as the
"Flyweight".

If I have time I will port kmheaders.cpp and kmfolder.cpp over to using the
flyweight pattern for KMHeaderItems (derived from QListViewItems) and for
KMMsgInfo objects.

BFN,
Don.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic