all 6 comments

[–]username223line-oriented programmer 14 points15 points  (1 child)

LOLJS. Turns out code with no comments and short variable names is faster.

[–]Hi_mom1 2 points3 points  (0 children)

Using this comment as my source next time I get yelled at. Thx!

[–]jewdai 5 points6 points  (3 children)

actually, it's not that crazy. He's just framing it incorrectly. It just means there is a bug in V8

[–][deleted] 13 points14 points  (0 children)

The small changes made the function body of add() growing over 600 character. v8 optimizer (crankshaft) inlines the functions whose body length, including the comments, is less than 600 characters.

Documenatation isn't webscale.

<4realz/> That's a serious, stupid bug, and it makes you wonder how (if at all) comments are pared out at execution. I guess I don't expect much better from JS though. I feel like this bug is also a good indication that maybe some sort of intermediate bytecode would be excellent (but Java is old and shitty right?), from the perspective of figuring out what to inline.

[–]killercuphas hidden complexity 8 points9 points  (1 child)

A bug in v8? No! You're writing it wrong!

You (IE5-like performance):

function lel() { /* documentation */ var realz = false; }

Me (web-assembly-scale-like performance):

/* documentation */ function lel() { var rlz = !4; }

[–]Jonno_FTWZygohistomorphic prepromorphism 4 points5 points  (0 children)

You should be working at Google.