From <rdar://problem/4946877> * SUMMARY Patch attached which avoids several unnecessary allocations, cutting down on time in malloc and free. 1. css/MediaQueryEvaluator.cpp, css/MediaQueryEvaluator.h, css/cssstyleselector.cpp Add a special method to the MediaQueryEvaluator class to avoid unnecessary turning a char * into a String object. 2. loader/Cache.cpp Don't turn a KURL's underlying String into another identical KURL. Or, even better, you could change the prototype to createResource to just take a String& instead of a KURL& and pass the url.url() to that, which is what createResource really wants to be doing anyway (since it only ever uses the String), but is no less work.
Created attachment 12655 [details] Nate's patch Here is the patch attached to the radar bug.
Comment on attachment 12655 [details] Nate's patch Looks good. r=me
I don't think change #2 will actually save any allocations, since creating a KURL from the DeprecatedString inside another KURL won't actually call malloc. It will needlessly reparse it though, so still a good change. This needs a ChangeLog and should be run through regression tests.
I ran the regression tests and wrote a change log. Committed revision 19156.