Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.1
-
None
-
Nokia Symbian^3
-
b3b7796178f6a94fc46ef827b01a46420dae5a50
Description
Repeated calls to QTextCodec::codecForName() requesting the same codec is very slow.
We have a usecase in webkit where NPAPIs used frequently. For each NPAPI call the string is processed by WebCore and the text is converted via QTextCodec. It is always using the same UTF-8 encoding. QTextCodec is maintaining a static list of all codecs as singletons, but it does text comparisons for all names and aliases in order to find the correct codec.
In our use case, we have found that looking up the codec is using over 50%of the CPU time and is extremely slow. We proppose to add a simple LRU fast cache in order to remove the duplicate work in retrieving the same codec over and over again.
The bug was logged to webkit but it has been suggested to move the cache to Qt's corelib.
https://bugs.webkit.org/show_bug.cgi?id=34489
Please find attached a sample implementation of a faster look up by storing the last used codec.
Attachments
Issue Links
- is required for
-
QTBUG-8234 Symbian3_2010_08
- Closed