News for hackers. Stuff that matters.
Re:Async Iterators: These Promises Are Killing My Performance by ilaksh on Sunday August 27, 2017 @02:39PM (#15111995)
Would be nice to say what version of Node.js.
Re:Async Iterators: These Promises Are Killing My Performance by wereHamster on Sunday August 27, 2017 @03:13PM (#15112196)
It doesn't matter which version of node. The fact that promises must be resolved in the next tick is baked into the spec, no upgrade of node will ever improve that situation.
Re:Async Iterators: These Promises Are Killing My Performance by jkrems on Sunday August 27, 2017 @05:59PM (#15113050)
> The fact that promises must be resolved in the next tick is baked into the spec

From all I know, that statement is false. Promises aren't resolved in the next tick. They should be resolved as part of the microtask queue which can happen at the end of the tick (recursively).

    Promise.resolve()
      .then(() => console.log('1'))
      .then(() => console.log('2'))
      .then(() => console.log('still the same tick!'));
    setTimeout(() => console.log('timeout happening in the next tick'), 0);
Result:

    1
    2
    still the same tick!
    timeout happening in the next tick
Re:Async Iterators: These Promises Are Killing My Performance by ilaksh on Sunday August 27, 2017 @04:39PM (#15112602)
Right but there were a lot of specific numbers so the context for specific benchmarks is versions.

Anyway it sounds like we should try to fix the spec.