In addition to the perf savings from not having to allocate (to call bind)
not needing to use bind() for cases like .find() can have beneficial
effects for JITs as well. It's my understanding that at a recent point in
time (maybe even still today?) functions created by bind() had the ability
to deoptimize call sites in V8 and Spidermonkey in certain scenarios. If
the existing design lets developers use free functions without having to
use bind(), that makes it easier for them to end up in the performance
sweet spot we know about when it comes to crunching data. The longer they
can stay in that sweet spot and still use built-ins like find/findIndex,
the better.


On Wed, Jul 10, 2013 at 10:28 AM, Brendan Eich <[email protected]> wrote:

> David Bruant wrote:
>
>> I can't find it anymore, but I read a message from Mike Shaver (I think
>> it was him) saying that these methods have been standardized after
>> SpiderMonkey implementation without other form of rationale.
>> Who needs this particular consistency anyway?
>>
>
> Users generally benefit from this kind of consistency; we hear complaints
> about reduce/reduceRight.
>
> The perf savings is an allocation, but the cognitive load win seems more
> important. Telling people to use .bind (polyfilled) involves more typing
> and thinking.
>
> /be
>
> ______________________________**_________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to