Closed stefanpenner closed 3 years ago
oh snap, good find! We should fix that!
Out of curiosity, is there a measurable performance impact you're seeing from this?
Out of curiosity, is there a measurable performance impact you're seeing from this?
Nah, it's most likely a tiny paper-cut among many :P. It isn't super critical, but something I noticed while debugging some code using ember-concurrency and I figured I would share :)
Both usages of
this.env.async
appear to rely onrun.once
, but pass dynamically created functions on each occurrence. Which means the de-duplication effort done byrun.once
is wasted:file:
addon/-private/external/task-instance/executor.js
has: 103: this.env.async(() => this.proceedSync(yieldResumeType, value)); 344: this.env.async(() => {where
async
is implemented viajoin(() => once(null, callback))
https://github.com/machty/ember-concurrency/blob/f53656876748973cf6638f14aab8a5c0776f5bba/addon/-private/ember-environment.js#L13The most conservative change to correct ^ would like be:
join(() => schedule('actions', callback))