Bug 136704 - [Curl] Optimization; avoid reallocating string many times.
Summary: [Curl] Optimization; avoid reallocating string many times.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-10 06:47 PDT by peavo
Modified: 2014-09-10 11:10 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.54 KB, patch)
2014-09-10 06:51 PDT, peavo
no flags Details | Formatted Diff | Diff
Patch (1.51 KB, patch)
2014-09-10 09:09 PDT, peavo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description peavo 2014-09-10 06:47:07 PDT
Adding individual characters to a string is inefficient, the string will be reallocated each time.
Comment 1 peavo 2014-09-10 06:51:25 PDT
Created attachment 237889 [details]
Patch
Comment 2 Alex Christensen 2014-09-10 08:29:23 PDT
Comment on attachment 237889 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=237889&action=review

> Source/WebCore/platform/network/curl/CookieJarCurl.cpp:42
> +    token = WTF::move(strToken);

Couldn't this be token=String(cookieStart, cookie - cookieStart) to avoid two lines and a move?
Comment 3 peavo 2014-09-10 09:09:08 PDT
Created attachment 237893 [details]
Patch
Comment 4 peavo 2014-09-10 09:09:40 PDT
(In reply to comment #2)
> (From update of attachment 237889 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=237889&action=review
> 
> > Source/WebCore/platform/network/curl/CookieJarCurl.cpp:42
> > +    token = WTF::move(strToken);
> 
> Couldn't this be token=String(cookieStart, cookie - cookieStart) to avoid two lines and a move?

Yes, thank you, updated patch :)
Comment 5 WebKit Commit Bot 2014-09-10 11:10:54 PDT
Comment on attachment 237893 [details]
Patch

Clearing flags on attachment: 237893

Committed r173474: <http://trac.webkit.org/changeset/173474>
Comment 6 WebKit Commit Bot 2014-09-10 11:10:57 PDT
All reviewed patches have been landed.  Closing bug.