Bug 33873

Summary: [qt] Make KURL to QUrl conversion faster
Product: WebKit Reporter: Holger Freyther <zecke>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Qt
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 34208    
Attachments:
Description Flags
Use QString::toUtf8 instead of WebCore::TextCodec eric: review+

Description Holger Freyther 2010-01-19 16:36:03 PST
Reloading google.com/news with a full font cache (no more calls to font cache) spend about 1.8% of the time in KURL -> QUrl conversion. The two call sites are from the FrameLoaderClientQt asking for the userAgentForUrl and in the ResourceHandleQt.cpp converting the ResourceRequest to a QNetworkRequest and using the URL.
Comment 1 Holger Freyther 2010-01-19 16:43:14 PST
Created attachment 46960 [details]
Use QString::toUtf8 instead of WebCore::TextCodec

Adopt the WebCore::String in a QString and use the Qt QString::toUtf8 method instead of going through WebCore::TextCodec -> QTextCodec and copying the buffer around.
Comment 2 Holger Freyther 2010-01-19 16:49:38 PST
Another way to make the KURL to QUrl conversion faster is to avoid going to a QByteArray and using QUrl::fromEncoded all together. We would have to call setPath, setHost, setUser, setPassword and see if that is any faster.
Comment 3 Eric Seidel (no email) 2010-01-21 16:52:25 PST
Comment on attachment 46960 [details]
Use QString::toUtf8 instead of WebCore::TextCodec

OK.
Comment 4 Holger Freyther 2010-01-28 03:54:44 PST
Landed in r53995. Thanks.