Hacker News new | ask | show | jobs
by austincheney 3032 days ago
The two expressions are equivalent. V8 cannot compile that logic into optimized bytecode due to a violation in its code engine that conflicts with other optimization logic. So instead of fast compiled code the code in the local scope of that expression is slow string interpreted code.

https://github.com/vhf/v8-bailout-reasons

2 comments

That list is for CrankShaft which has been replaced by TurboFan > 6 months ago. If you continue to experience slowdowns please file a bug and it can be investigated.
There's an automotive engineer somewhere reading this, irrationally upset at the idea of replacing a crankshaft with a turbofan.
Do you have a source that cites the += example? I can't seem to find it on the page you linked.
I remember seeing the cause of this specific case mentioned in a slide deck by one of the V8 engineers. I don't remember where online it is. I was to validate this performance limitation more than a year ago through self-testing in my personal code.

As titzer mentioned this issue may no longer exist. I would have to run additional tests to independently make an assessment with the current V8.