[v8-users] .map is slower than for

2013-02-04 Thread Andrii Melnykov
http://hpaste.org/81784 contains a benchmark - slow_test() is twice as slow as fast_test() tool.js is my wrapper around benchmark npm module, feel free to use whatever you use to benchmark V8 as the problem doesn't seem to be specific to node.js Should such performance degradations in

Re: [v8-users] .map is slower than for

2013-02-04 Thread Sven Panne
On Mon, Feb 4, 2013 at 3:58 PM, Andrii Melnykov andy.melni...@gmail.comwrote: http://hpaste.org/81784 contains a benchmark - slow_test() is twice as slow as fast_test() [...] The way Array.prototype.map is specified (see section 15.4.4.19 in the ECMA spec) makes it very hard to implement

Re: [v8-users] .map is slower than for

2013-02-04 Thread Vyacheslav Egorov
I'd say it's a known issue that generic Array built-ins are slower than handwritten less generic versions. Array you are mapping over is extremely small so all overheads of a generic implementation are highlighted. For example %MoveArrayContents amounts to 20% of the overheads, while in reallity

Re: [v8-users] .map is slower than for

2013-02-04 Thread Andrii Melnykov
On Monday, February 4, 2013 5:14:05 PM UTC+2, Sven Panne wrote: On Mon, Feb 4, 2013 at 3:58 PM, Andrii Melnykov andy.m...@gmail.comjavascript: wrote: http://hpaste.org/81784 contains a benchmark - slow_test() is twice as slow as fast_test() [...] Furthermore, we don't do any