Open Bug 961977 Opened 10 years ago Updated 4 months ago

IonMonkey: Consider Inlining Array.prototype.slice

Categories

(Core :: JavaScript Engine: JIT, defect, P3)

x86
macOS
defect

Tracking

()

People

(Reporter: isk, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

Attached file array_slice_bench.js
I'm attaching a shell test case.

d8: 631ms
SM: 2145ms

SM is slower than d8.
I think this is because Array#slice is not inlined.
Status: NEW → ASSIGNED
Do you think that based on profiling, or something else?
Just wondering, what are the results if you replace arr.slice() by res.slice(), and do res = arr.slice() before the loop?
(In reply to Boris Zbarsky [:bz] from comment #1)
> Do you think that based on profiling, or something else?
Sorry I don't have exactly basis.
I think inlining Array#slice can be fast because It is similar to MStringSplit. 
But I don't have any profiling which indicate the cause is it.
(In reply to Nicolas B. Pierron [:nbp] from comment #2)
> Just wondering, what are the results if you replace arr.slice() by
> res.slice(), and do res = arr.slice() before the loop?

I measured it.
The both result is the same.
SM: 900ms
node: 490ms
Assignee: iseki.m.aa → nobody
Blocks: jsperf
Status: ASSIGNED → NEW
Keywords: perf
Priority: -- → P3
don't forget the ability to do Array==Array.slice()
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.