News for hackers. Stuff that matters.
Re:Node v6.9.0 (LTS) by m1sta_ on Tuesday October 18, 2016 @09:48PM (#12740352)
I'm not debating the point, but how is that possible?
Re:Node v6.9.0 (LTS) by bananaoomarang on Wednesday October 19, 2016 @03:09AM (#12741713)
Re:Node v6.9.0 (LTS) by sotojuan on Wednesday October 19, 2016 @12:29AM (#12741071)
I'm not sure how it's possible but it's definitely not rare. Lodash' methods are faster than their respective native implementations (Lodash `map` > `Array.prototype.map`).
Re:Node v6.9.0 (LTS) by JaRail on Wednesday October 19, 2016 @03:11AM (#12741720)
As a general answer, doing something simple in pure JS can be more efficient than the overhead associated with making a native call from JS. The costs are going to vary depending on how the JIT handles things. That's probably the best general reason though as to how it's possible.
Re:Node v6.9.0 (LTS) by scrabble on Wednesday October 19, 2016 @01:24PM (#12745719)
As I understand it, native promises don't make native system calls. They are still pure js. They are just implemented differently from Bluebird which optimizes for the most common use cases.
Re:Node v6.9.0 (LTS) by STRiDEX on Tuesday October 18, 2016 @10:26PM (#12740519)
http://programmers.stackexchange.com/questions/278778/why-ar...

I'm not sure all of it still stands. Bluebird is in C. Native is in javascript.

Edit: i'm wrong

Re:Node v6.9.0 (LTS) by mscdex on Tuesday October 18, 2016 @11:06PM (#12740700)
Bluebird isn't written in C. It doesn't even depend on a compiled node addon.
Re:Node v6.9.0 (LTS) by STRiDEX on Wednesday October 19, 2016 @12:09AM (#12741005)