Closed Bug 813727 Opened 12 years ago Closed 5 years ago

IonMonkey: Implement atom inequalities.

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 813836

People

(Reporter: zbraniecki, Unassigned)

Details

Attachments

(1 file)

Attached file demo html
when iterating over string and doing character comparison the JS engine is two times slower than V8.
v8 generates code for character compares. We only have one very simple optimization for ==/!=. Which checks for ptr==ptr, atoms and string length. I think optimizing this very case could be simple. Last time I tried implementing a whole string compare path everything got very ugly, because of register pressure.
The problem is that IonMonkey does not yet provide a fast path for atom inequalities (see MCompare::infer in ion/MIR.cpp), so currently the result of  charAt  returns another atom which is boxed and pushed twice to call into a VM function which unbox its operands and compare the atoms.

Note: x2 times slower does not seems too bad knowing the overhead of VM function calls, both in terms of spilling and it terms of number of instructions.
Summary: V8 is x2 faster than Spidermonkey on character comparison → IonMonkey: Implement atom inequalities.
Assignee: general → nobody

Fixed through bug 813836.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: