Bug 23622 - create CFString and NSString objects from WebCore::String without copying the characters
Summary: create CFString and NSString objects from WebCore::String without copying the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-29 09:50 PST by Darin Adler
Modified: 2009-02-01 07:28 PST (History)
3 users (show)

See Also:


Attachments
fist steps (2.66 KB, patch)
2009-01-29 09:51 PST, Darin Adler
no flags Details | Formatted Diff | Diff
patch (7.08 KB, patch)
2009-01-30 10:09 PST, Darin Adler
darin: review-
Details | Formatted Diff | Diff
patch -- this time I think it handles threading acceptably (8.01 KB, patch)
2009-01-30 17:56 PST, Darin Adler
mrowe: review+
Details | Formatted Diff | Diff
final patch with changes requested by Mark (7.94 KB, patch)
2009-01-30 18:18 PST, Darin Adler
no flags Details | Formatted Diff | Diff
more final (7.91 KB, patch)
2009-01-30 18:26 PST, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2009-01-29 09:50:18 PST
Mark and I realized this is possible and we think it will be a good performance optimization.
Comment 1 Darin Adler 2009-01-29 09:51:01 PST
Created attachment 27150 [details]
fist steps
Comment 2 Darin Adler 2009-01-30 10:09:17 PST
Created attachment 27186 [details]
patch
Comment 3 Darin Adler 2009-01-30 10:29:28 PST
Comment on attachment 27186 [details]
patch

Non-main-thread handling is wrong here. I'll have to make a new version.
Comment 4 Mark Rowe (bdash) 2009-01-30 11:54:01 PST
Comment on attachment 27186 [details]
patch

Shouldn't the #if PLATFORM(MAC) || !defined(BUILDING_ON_TIGER) checks have an && rather than ||?
Comment 5 Darin Adler 2009-01-30 12:14:57 PST
(In reply to comment #4)
> Shouldn't the #if PLATFORM(MAC) || !defined(BUILDING_ON_TIGER) checks have an
> && rather than ||?

Yes. Thanks for spotting that.

Comment 6 Darin Adler 2009-01-30 17:56:38 PST
Created attachment 27205 [details]
patch -- this time I think it handles threading acceptably
Comment 7 Mark Rowe (bdash) 2009-01-30 18:12:36 PST
Comment on attachment 27205 [details]
patch -- this time I think it handles threading acceptably

The calls to the system memory allocator should probably use FastMalloc instead, and the code may be slightly easier to follow if create() and allocator() were closer in the code.

r=me
Comment 8 Darin Adler 2009-01-30 18:18:23 PST
I'm going to attach the final patch here so Stephanie can more easily do some performance testing rolling it in and out.
Comment 9 Darin Adler 2009-01-30 18:18:44 PST
Created attachment 27206 [details]
final patch with changes requested by Mark
Comment 10 Darin Adler 2009-01-30 18:26:59 PST
Created attachment 27208 [details]
more final
Comment 11 Darin Adler 2009-02-01 07:28:08 PST
http://trac.webkit.org/changeset/40438