Revision 2cd2d1a...

Go back to digest for 25th September 2011

Optimization in KDE Base

Andreas Hartmetz committed changes in [kdelibs/KDE/4.7] /kio:

Undo manager: Don't prepend() to a QVector which can contain many, many items.

Use a QList instead.
A QStack is a QVector, which has an O(n) prepend method.
Conceptually it is a stack, but not always used like one, so I
haven't renamed the typedefs, so the code looks a bit (more) confusing
now. Sorry about that.
I noticed that copying several 100k files slowed down to just a few
files a second and found that most of the time was spent in
QVector<KIO::BasicOperation>::prepend(), called from
KIO::CommandRecorder::slotCopyingDone().
Another problem is memory usage, which was a few hundred megabytes.
This patch does not fix memory usage because I have a lot of memory
and it's a difficult problem :)

File Changes

Modified 2 files
  • /kio
  •   kio/fileundomanager.cpp
  •   kio/fileundomanager_p.h
2 files changed in total