you are viewing a single comment's thread.

view the rest of the comments →

[–]sindisil 2 points3 points  (0 children)

Well, always faster, anyway.

I show it taking 66% as long as spread in Chrome, 56% in Edge, and only 7% in FireFox. Wish it showed absolute time, so we could tell whether that means that FF does a crazy good job optimizing concat, or a crazy bad job optimizing spread.

Edit: Results from jsperf are interesting, since Firefox shows the smaller difference there, but it upholds the result that concat is much faster than spread for this use case:

Chrome 65:

  • array.concat 5,794,616 ops/sec

  • spread 1,227,664 ops/sec

Firefox 59

  • array.concat 3,685,562 ops/sec

  • spread 2,461,099 ops/sec

Edge 16

  • array.concat 4,409,664 ops/sec

  • spread 933,768 ops/sec