Bug 24463 - Do not detach/copy QString twice in WebCore::qstring
Summary: Do not detach/copy QString twice in WebCore::qstring
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-09 09:17 PDT by Adam Treat
Modified: 2009-03-09 09:39 PDT (History)
2 users (show)

See Also:


Attachments
Don't detach so often (3.92 KB, patch)
2009-03-09 09:21 PDT, Adam Treat
staikos: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Treat 2009-03-09 09:17:18 PDT
Currently, WebCore::qstring is detaching and copying twice for every single TextRun that is processed and drawn.  This is a very expensive operation and profiling suggests this method is one of the top ten most expensive operations in all of QtWebKit.  The patch attached minimizes the QString copying/detaching to only those cases where it is necessary.

Even with this change this method is still a very expensive operation since almost all TextRuns contain a character that needs special handling by the QTextEngine.  A forthcoming patch will address this too, but it requires an addition to Qt's API.
Comment 1 Adam Treat 2009-03-09 09:21:43 PDT
Created attachment 28414 [details]
Don't detach so often
Comment 2 Adam Treat 2009-03-09 09:39:34 PDT
Landed with r41527.