clue · GitHub

This change applies some performance improvements by avoiding unneeded references in the internal FiberMap. This is a purely internal change that comes with 100% code coverage and does not otherwise affect the public API, so it should be safe to apply.

This happens to show a ~10% performance improvement in my synthetic benchmark:

async(function () {
    $promise = resolve(42);
    $n = 10_000_000;
    for ($i = 0; $i < $n; ++$i) {
        await($promise);
    }
})();
// old: 3.9s
// new: 3.5s

(Also posted in https://twitter.com/another_clue/status/1793723464194638108)

This code path only affects v4, so there is no need to backport this to v3 or v2.

Builds on top of #55 and #20

Read the original on github.com ↗