Closed
Bug 781145
Opened 11 years ago
Closed 11 years ago
IonMonkey: js::GetProperty should have a fast path for string/array length access
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
(Whiteboard: [ion:p1:fx18])
Attachments
(1 file)
3.77 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
GetPropertyOperation has a fast path for JSOP_LENGTH. This is important for strings because apparently it avoids creating lots of string objects. This patch factors it out and also calls it from js::GetProperty. Numbers for the micro-benchmark below: JM+TI (--no-ion) : 2 ms Ion (new) : 13 ms Ion (old) : 79 ms JM+TI is still much faster because its IC can handle the mixed object/string case, while Ion only uses an IC if the value is definitely an object. The attached patch is pretty straight-forward though and is a tiny date-format-xparb win. function f() { var x = new String("foo"); var res = 0; for (var i=0; i<1000000; i++) { res += x.length; x = "foo"; } return res; } var t = dateNow(); f(); print(dateNow() - t);
Attachment #650048 -
Flags: review?(dvander)
![]() |
||
Comment 1•11 years ago
|
||
Worth a followup on improving the IC setup?
![]() |
||
Updated•11 years ago
|
Attachment #650048 -
Flags: review?(dvander) → review+
![]() |
||
Updated•11 years ago
|
Whiteboard: [ion:p1:fx18]
Assignee | ||
Comment 2•11 years ago
|
||
https://hg.mozilla.org/projects/ionmonkey/rev/e10b81f123e6 (In reply to Boris Zbarsky (:bz) [In and out Aug 1 - 10, out Aug 11-20] from comment #1) > Worth a followup on improving the IC setup? Fixing it wouldn't be noticeable on date-format-xparb, and I doubt this mixed object/string case is common in performance-critical code. So I'm inclined to wait until we know it really is a problem we have to fix.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•