- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Fri, 23 Dec 2011 22:38:45 -0500
- To: Jake Verbaten <raynos2@gmail.com>
- CC: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, www-dom@w3.org
On 12/23/11 8:09 PM, Jake Verbaten wrote: > To add to the conversation. A recent jsperf > http://jsperf.com/toarray-vs-slice shows that toArray and slice.call > have similar levels of performance depending on array sizes. For what it's worth, this is also passing Arrays to both toArray and slice.call, not nodelists. The performance characteristics can be pretty different (e.g. slice() has a fast-path for dense arrays in SpiderMonkey that just does a single memcpy). > And I believe es.next will have Array.from ( > https://mail.mozilla.org/pipermail/es-discuss/2011-July/015831.html ) > which is basically an official readable method to turn an array like > into an array. That seems like the way to go to me. -Boris
Received on Saturday, 24 December 2011 03:39:30 UTC