3 ms·
For context, this is https://code.google.com/p/v8/issues/detail?id=3354 https://code.google.com/p/v8/issues/detail?id=3354 JSPerf test case has misleading name
by mraleph 12y ago
For context, this is https://code.google.com/p/v8/issues/detail?id=3354 https://code.google.com/p/v8/issues/detail?id=3354
JSPerf test case has misleading name: it has nothing to do with inline caching, but it is indeed related to inlining heuristics. V8 uses source size in heuristics for historical reasons and source size includes comments (see the issue above for more info).
Saying that comments slow down your code by 70% is an exaggeration: if you remove all comments from your code it is unlikely that you will get 70% speedup across the board on V8, though potentially you might get some. Test case is really written in a way that highlights the issue, because loop itself is tight, it's doing nothing but a monomorphic function call and target function also is doing mostly nothing - this makes inlining of the callee essential for peak performance here. It is unlikely however that your code contains a lot of loops like this.
- zallek 12y ago"It is unlikely however that your code contains a lot of loops like this." Absolutely agree.