Title is essentially a lie. These are not javascript performance tips, they are V8 performance tips and may or may not apply to other javascript runtimes. Not only that, but:
* during the presentation Daniel made clear some of these issues are considered bugs, not structural and the V8 team intends to fix them
* whoever "wrote" the list managed to not even understand what was said. Case in point:
Don’t use try {} catch {} blocks
is nonsense, Daniel never said that. What he said is to not mix try blocks and actual processing, because Chrome's optimizer currently can not work on methods with try blocks. The solution being not "Don't use try/catch blocks" but "extract the actual work in a separate function, which can be optimized"
or
Avoid hidden class changes in functions after they are optimized
Watch the talk (if you have not already), read the slides, but do not read this list, it's worthless and will actually mislead you, half the point range from just wrong to the opposite of what Daniel explained. It looks like whoever dumped this "read" the slides without watching the presentation.
1 comment
[ 3.0 ms ] story [ 17.5 ms ] thread* during the presentation Daniel made clear some of these issues are considered bugs, not structural and the V8 team intends to fix them
* whoever "wrote" the list managed to not even understand what was said. Case in point:
is nonsense, Daniel never said that. What he said is to not mix try blocks and actual processing, because Chrome's optimizer currently can not work on methods with try blocks. The solution being not "Don't use try/catch blocks" but "extract the actual work in a separate function, which can be optimized"or
Watch the talk (if you have not already), read the slides, but do not read this list, it's worthless and will actually mislead you, half the point range from just wrong to the opposite of what Daniel explained. It looks like whoever dumped this "read" the slides without watching the presentation.