diff options
author | Jos van den Oever <jos@vandenoever.info> | 2009-10-01 16:49:27 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-13 10:29:10 (GMT) |
commit | 60d2ab05c350f866f942a35f341f455015fdb800 (patch) | |
tree | 206aa7567c25c5a85cebe2938d924b6159d3a5f9 /src/gui/dialogs | |
parent | e6be9c88bc98481936fcba7fa1cfb4e255f6e30b (diff) | |
download | Qt-60d2ab05c350f866f942a35f341f455015fdb800.zip Qt-60d2ab05c350f866f942a35f341f455015fdb800.tar.gz Qt-60d2ab05c350f866f942a35f341f455015fdb800.tar.bz2 |
Speed up QTextFormatCollection::indexForFormat
QTextFormatCollection currently has two problems:
- looking for the index of a QTextFormat is linear, this can take 25%
cpu when loading large documents in kword
- the hash function for QTextFormat is inadequate. Not all values are
treated specially. E.g. each QBrush instance has the same hash value
at the moment.
These patches speed up loading of a large text document in KWord from 9
to 7 seconds.
This fixes this by using QMultiHash to group the QTextFormat instances
by hash and only loop through that list when looking up values. It also
improves the hash function for QTextFormat.
Merge-request: 1623
Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/gui/dialogs')
0 files changed, 0 insertions, 0 deletions