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.
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.
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 on attachment 46960 [details] Use QString::toUtf8 instead of WebCore::TextCodec OK.
Landed in r53995. Thanks.