News for hackers. Stuff that matters.
Re:Show HN: Cancelable async primitives for JavaScript by pspeter3 on Tuesday August 08, 2017 @04:46PM (#14962494)
Interesting, I would have assumed that relying on VM scheduling would be more efficient.

As a corollary, are custom promises faster than native promises?

Re:Show HN: Cancelable async primitives for JavaScript by Mitranim on Tuesday August 08, 2017 @04:51PM (#14962559)
Yes. Some popular promise polyfills totally trash the performance of "native" promises. I don't quite remember which ones. Needless to say, Posterus also compares very well in this field.
Re:Show HN: Cancelable async primitives for JavaScript by pspeter3 on Tuesday August 08, 2017 @04:53PM (#14962594)
Hmm, I'll have to look for benchmarks then. My general experience is that it is hard to outsmart the VM performance wise in the long run
Re:Show HN: Cancelable async primitives for JavaScript by Mitranim on Tuesday August 08, 2017 @05:01PM (#14962666)
We're not competing with VMs here. From what I hear, like many other built-ins, "native" promises in every VM are implemented in JavaScript. They're not always well done (V8 promises were really bad for a while), and pay a mandatory overhead for useless "privacy" features dictated by the spec.