Try-Catch optimization in Turbofan

439 views
Skip to first unread message

Ali Ghassemi

unread,
Jul 18, 2016, 9:14:29 AM7/18/16
to v8-users
Hi V8 team,

I am just wondering how I can find out when/if Try-Catch optimization will ship with Turbofan/V8/Chrome. I know there has been a few attempts to ship it and the latest is https://codereview.chromium.org/1996373002 but I can't tell ultimately what version of Chrome is planned to have that change.

Thanks,
Ali

Michael Hablich

unread,
Jul 18, 2016, 10:55:17 AM7/18/16
to v8-users
What is the reason the optimization is important to you?

Ali Ghassemi

unread,
Jul 18, 2016, 11:36:02 AM7/18/16
to v8-users
Performance is fairly important in AMP (https://www.ampproject.org/) and we try to optimize the JS code as much as possible. Currently we have externed multiple try-catch statements out of busy functions and have a small Closure compiler customization so it does not inline them again. Having this optimization ship will mean one less thing to worry about when writing code. 

Thanks!
-Ali

Michael Hablich

unread,
Jul 20, 2016, 4:48:02 AM7/20/16
to v8-users
IC. The optimization in TurboFan is likely going to stick. Keep in mind that this does not mean that try/catch magically gets faster though. Do you have performance comparisons for AMP for try/catch? That would be highly interesting.

Cheers,
Michael

Ali Ghassemi

unread,
Jul 20, 2016, 12:43:30 PM7/20/16
to v8-users
Thanks Michael. I don't have specific numbers for AMP but currently try-catch deoptimization the whole function (quick fiddle here: https://jsfiddle.net/sqnjwp2z/3/) so we have started extering anything with TryCatch into its own function. If https://codereview.chromium.org/1996373002 sticks, it is just one less thing we need to worry about when writing/reviewing code.
Reply all
Reply to author
Forward
0 new messages