News for hackers. Stuff that matters.
Re:Currying in JavaScript by satori99 on Sunday July 19, 2015 @08:14PM (#9913386)
I recently became aware that functions returned from bind perform realtively poorly in modern browsers. I am not sure of exactly why, but a simple closure outperforms the functions returned from bind() significantly in all the browsers i have ever tested in.

If performance matters native bind() can be a pain.

Re:Currying in JavaScript by kevincennis on Sunday July 19, 2015 @08:19PM (#9913398)
It's all relative, right?

If I'm writing some super perf-sensitive code like manipulating an array of PCM data for Web Audio stuff or doing a complex canvas animation, then the savings of not using Function#bind are probably kind of important.

For most everyday code, avoiding bind() kind of feels like premature optimization to me.

Re:Currying in JavaScript by satori99 on Sunday July 19, 2015 @08:26PM (#9913419)
Yeah, definately a realtive issue. And also easy to fix after the fact, but as you say, it becomes important for inner-loop stuff.

I spent a few hours removing it from a codebase of mine last week, to see substantial improvements on all browsers.