<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 26, 2017 at 8:16 PM, Ehsan Akhgari <span dir="ltr"><<a href="mailto:ehsan.akhgari@gmail.com" target="_blank">ehsan.akhgari@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 2017-03-17 7:41 PM, Kris Maglione wrote:<br>
> On Fri, Mar 17, 2017 at 07:30:46PM -0400, Ehsan Akhgari wrote:<br>
>> Have we measured the performance of our async/await implementation? I<br>
>> think we should definitely do some extensive testing of the performance<br>
>> of any new ES primitives before deciding to switch to using them in the<br>
>> front-end code en masse. Of course, if the performance result aren't<br>
>> good, that doesn't mean we shouldn't use them in the front-end code, it<br>
>> means we need to make the performance better. :-) But we need to be<br>
>> able to make the trade-off cautiously.<br>
><br>
> Yes. There was performance testing for the self-hosted version (which<br>
> was basically the same as the Promise.jsm implementation) before it was<br>
> converted to C++, and after:<br>
><br>
> <a href="https://bugzil.la/1314055" rel="noreferrer" target="_blank">https://bugzil.la/1314055</a><br>
><br>
> In short, it's better, but not hugely.<br>
<br>
</span>That's quite nice if you ask me. :-) I have see code surrounding this<br>
stuff show up in profiles a lot, although I admit I haven't had a way to<br>
measure the overhead of this part directly. And often times the way<br>
that this matters is in a "death by a thousand cuts" scenario, i.e.,<br>
when in some edge case something is taking super long, this overhead<br>
makes things much worse, so I'm really happy to see this happening!<br></blockquote><div><br></div><div>Additionally, the async/await implementation will get faster eventually. There are quite a few ways to optimize it which we haven't yet implemented. They're not exactly trivial, so this isn't necessarily a short-term thing, but they'll definitely happen. So if we change as much code as possible to using async/await instead of Promise.jsm, we'll get the benefits of this automatically in many areas of the browser.<br></div></div></div></div>