is Promise.prototype.then the fastest “nextTick”?
I spent the past week optimizing the startup performance of a Firefox OS web app. While analyzing the profile and timeline data I realized that the DOMEvent
“message” was causing a considerable delay – That “message” is actually based on David Baron’s setZeroTimeout
function, which is used a few times along the codebase; So I had the idea to use a resolved Promise and check if it was going to change anything and I was impressed with the performance gains! So I decided to search if anyone else got into the same results, but couldn’t find anything and decided to write this post.