4 ms·
This is cool, but hitting break on the single timeout example in Firefox suggests that this code is actually filling the stack up pretty quickly, once per itera
by mmastrac 3y ago
This is cool, but hitting break on the single timeout example in Firefox suggests that this code is actually filling the stack up pretty quickly, once per iteration through the loop.
The concept is neat, though: it's basically handing off a number of callbacks. Under the hood I think you'll find that it's just a really expensive version of `Promise.then`.
- pwpwp 3y agoThis appears to be an artefact of the "async call stacks" feature. To turn it off in Firefox, go to about:config and set "javascript.options.asyncstack" to false. In Chrome, in Devtools enter ctrl+shift+p and search for "async stack traces".
- pwpwp 3y agoIOW, there isn't any real stack growth, it just appears that way when running in the devtools with the "async call stacks" feature enabled.