String.protoype.toLower() uses UString.characters() and should be optimized for the underlying character size.
Created attachment 116647 [details] Patch This speeds up sun spider string-tagcloud by 7%.
Comment on attachment 116647 [details] Patch Can you put the perf effect in the ChangeLog?
Committed r101187: <http://trac.webkit.org/changeset/101187>
This removes the optimization for the case where the string was already all lowercase. It seems we could easily retain that by checking if the result of s.impl()->lower() is == s.impl() and if so, returning JSValue::encode(sVal).
(In reply to comment #4) > This removes the optimization for the case where the string was already all lowercase. It seems we could easily retain that by checking if the result of s.impl()->lower() is == s.impl() and if so, returning JSValue::encode(sVal). I had played with this a little and didn't get the return right so it failed some sputnik tests. I just coded up a correct "already lower case" return and will be posting it in another bug. It appears that the fast return is worth maybe a little in sun spider performance (.2ms overall).