Thanks, kg! Your message represents the kind of discussion/information I was hoping for. If your hunch as to the reason is correct, it would seem an easy target for optimization. Partially and efficiently emulating arrow functions in ES6 transpilers should be a strong argument in favor, though
not the only one (eg bind keeps coming up as a recommendation when
using class methods as callback parameters, etc.).

For those interested, I've put my (micro) bench in a gist:

   https://gist.github.com/clausreinke/5987876

   (note in particular the performance difference between
   .bind and an .apply-based polyfill; other engines do worse)

I used es-discuss for this thread because:

- all engines are slow on .bind, so it is likely a general issue

- all engines are slow on .bind, so recommending .bind as freely as
   I (and several people on this list) used to do does not seem realistic;
   that puts a serious dent in the usability of this part of the spec

- even if that issue may turn out not to be spec-related, this is the only
   list I know of where I can reach all engine developers and es language
gurus at once.
   If this kind of es implementation/performance discussion is not
welcome here, a dedicated cross-engine list for such topics would be nice. Would only work if all engines had developers listening in.

As long as there isn't enough traffic to warrant a dedicated list, I (as one of the list owners there) welcome such threads on js-tools

   http://groups.google.com/group/js-tools/about

   (on the basis that engines are our most fundamental js tools;-)

Please let me know where to raise such cross-engine threads in future.
Claus

I've had some back and forth with v8 devs about this since it affects my
compiler. I believe they already have open issues about it but I don't know
the bug #s.

In general, the problem seems to be that Function.bind creates functions
that have different type information from normal functions you wrote in
pure JS; they're 'special' native functions in the same fashion as say, a
DOM API:
...
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to