When sorting a JSArray, one of the bottleneck is the conversion from StringImpl::getData16SlowCase()
Created attachment 131773 [details] Patch
Comment on attachment 131773 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=131773&action=review > Source/JavaScriptCore/wtf/text/StringImpl.h:782 > + if (string1 && string2) { It would be better to NULL check string1 and string2 at the head of the function, and return early if NULL, rather than NULL checking more than once in the body of the function, and indenting so much of the code. I think this would work: if (!string1) return -1; if (!string2) return string1->length(); ....
> if (!string2) > return string1->length(); Oops! if (!string2) return string1->length() ? 1 : -1;
> It would be better to NULL check string1 and string2 at the head of the function, and return early if NULL, rather than NULL checking more than once in the body of the function, and indenting so much of the code. I think this would work: Good point! I'll update that Thanks for the review.
Committed r110822: <http://trac.webkit.org/changeset/110822>