Closed
Bug 609075
Opened 14 years ago
Closed 14 years ago
speed up JSString::flatten a bit
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: luke, Assigned: luke)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(3 files)
3.70 KB,
text/plain
|
Details | |
833 bytes,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
8.47 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
The attached patches tweak JSString::flatten/js_ConcatStrings. I'm measuring a 1-2% (2-4ms) win on SS and .5% (10ms) win on V8 (SS harness -m). A micro-benchmark under valgrind shows a 38% decrease in instruction count in flatten.
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #487642 -
Flags: review?(alangpierce)
Assignee | ||
Updated•14 years ago
|
Attachment #487641 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 2•14 years ago
|
||
Attachment #487650 -
Flags: review?(alangpierce)
Assignee | ||
Comment 3•14 years ago
|
||
I had a third patch that took out the "grow the left string in-place if there is room" case, but I remembered what it was for, so no change to js_ConcatStrings. (It's for cases like
for (...) {
x = x + "asdf";
print(x); // flatten x
}
where x is flatten on each iteration to avoid O(n^2) copying. I think this case can be removed in bug 608776 by having flatten() do it.)
Summary: speed up JSString::flatten/js_ConcatStrings a bit → speed up JSString::flatten a bit
Assignee | ||
Updated•14 years ago
|
Attachment #487642 -
Flags: review?(alangpierce) → review?(gal)
Assignee | ||
Comment 4•14 years ago
|
||
Comment on attachment 487650 [details] [diff] [review]
optimize flatten
Andreas, I think you reviewed the initial ropes patch.
Attachment #487650 -
Flags: review?(alangpierce) → review?(gal)
Updated•14 years ago
|
Attachment #487642 -
Flags: review?(gal) → review+
Comment 5•14 years ago
|
||
Comment on attachment 487650 [details] [diff] [review]
optimize flatten
Nice profiling job Luke. ++lw
Attachment #487650 -
Flags: review?(gal) → review+
Assignee | ||
Comment 6•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/0ba07bd00178
http://hg.mozilla.org/tracemonkey/rev/9e5cd5815d4d
Whiteboard: fixed-in-tracemonkey
Comment 7•14 years ago
|
||
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
•