Closed
Bug 551110
Opened 14 years ago
Closed 14 years ago
Should we special-case length-1 strings? If so, where?
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Unassigned)
Details
We may be able to use unitStringTable or just length-checks to optimize various operations (e.g. js_StringToNumber) for unit strings. jsc does this; see https://bugs.webkit.org/show_bug.cgi?id=20333 It looks like js_EqualStrings doesn't use memcmp anyway, but we could maybe add a fast-path to js_StringToNumber if bug 551109 doesn't help enough. Worth measuring on the string-base64 test to see where we spend time.
Reporter | ||
Comment 1•14 years ago
|
||
Note that we already have something like this special case in js_StringToInt32. We don't have it in js_ValueToNumber, though, or js_StringToNumber.
Reporter | ||
Comment 2•14 years ago
|
||
That happened in bug 514267, apparently.
Comment 3•14 years ago
|
||
I tried it last summer for string concatenation. There is a benchmark in SS that creates a huge string by just adding one character at the end all the time. I tried a fast-path but the winnings were minimal and small regressions at other benchmarks so we didn't do it.
Reporter | ||
Comment 4•14 years ago
|
||
And we recently expanded the js_StringToInt32 case to cover js_ValueToNumber and js_StringToNumber. Maybe we should just declare this either fixed or wontfix depending on mood. ;)
Comment 5•14 years ago
|
||
bz: please mark FIXED if you agree that's better (I think it is). /be
Reporter | ||
Comment 6•14 years ago
|
||
Sold.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•