Summary: | Kopete has full CPU load (freezes) when receiving a long line | ||
---|---|---|---|
Product: | [Applications] kopete | Reporter: | Matija Šuklje <matija> |
Component: | general | Assignee: | Kopete Developers <kopete-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: |
Description
Matija Šuklje
2008-10-10 01:11:51 UTC
Oh, dear. It seems I've misunderstood her — she didn't try to send me a long line of characters, but cca. a hundred animated smiles (the same one, only repeated a hundred times in the same "line"). Hmm, should I close this one and make a new bug? The slow part is QTextDocument::setHtml in libkopete/kopetemessage.cpp Message::doSetBody. We use QTextDocument because we need toPlainText function. So is there any faster way to convert html to plain text? The next slower part is KEmoticonsTheme::tokenize but tokenize is 6 times faster than setHtml. SVN commit 872704 by rjarosz: Fix bug 172485 Kopete has full CPU load (freezes) when receiving a long line. The message.setHtmlBody( message.parsedBody() ); which should cache the emoticons actually didn't cache it and it made it even worse because setHtml is much slower than parsedBody if we have many emoticons (html tags). So this patch removes this line and adds caching into the parsedBody function. The great thing is that we don't have to call setHtml which was the bottleneck. BUG: 172485 M +1 -9 kopete/chatwindow/chatmessagepart.cpp M +14 -3 libkopete/kopetemessage.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=872704 Will this be uploaded to trunk and if so, which version(s) will include the patch already? This is already in trunk see Comment #3, I'll also backport it for KDE 4.1.3. SVN commit 872808 by rjarosz: Backport SVN commit 872704. Fix bug 172485 Kopete has full CPU load (freezes) when receiving a long line. CCBUG: 172485 M +0 -5 kopete/chatwindow/chatmessagepart.cpp M +13 -3 libkopete/kopetemessage.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=872808 Thank you :) |