Array.prototype.sort is slow on very sparse arrays

ASSIGNED
Assigned to

Status

()

Core
JavaScript: Standard Library
P3
normal
ASSIGNED
3 months ago
17 days ago

People

(Reporter: anba, Assigned: anba)

Tracking

(Blocks: 1 bug, {perf})

Trunk
Points:
---

Firefox Tracking Flags

(firefox57 affected)

Details

(Whiteboard: [qf:p3])

(Assignee)

Description

3 months ago
bug 1368978 adds a new helper function to delete element ranges more quickly. With some additional changes, we should be apply to make this test case much faster:

  var array = new Array(2**25);
  var t = dateNow();
  array.sort();
  print(dateNow() - t);

This is mostly an issue for the native sort() implementation: Needs 9500ms for me with the native sort implementation, but only 300ms when the self-hosted sort implementation is called.
status-firefox57: --- → affected
Priority: -- → P3
Whiteboard: [qf:p3]
Keywords: perf
You need to log in before you can comment on or make changes to this bug.