3 ms·
Then the next guy comes and complains why `var a = 42` is slower than `var abc = 42`. And so on. I wonder if it also counts comments. It soon becomes quite comp
by albertzeyer 10y ago
Then the next guy comes and complains why `var a = 42` is slower than `var abc = 42`. And so on. I wonder if it also counts comments. It soon becomes quite complicated. Maybe you can count the number of dots in non-comments and non-strings and will get a better heuristic.
- girvo 10y ago> I wonder if it also counts comments. It does! If I remember correctly, there's a great gist floating around that shows this off, where the comment itself is what caused two functions to be different in performance, despite being identical ;)
- diggan 10y agoI think you're thinking about "Optimization killers" (https://news.ycombinator.com/item?id=7943303 https://news.ycombinator.com/item?id=7943303 [which funnily, I submitted 754 days ago!]), but it just touches V8. Haven't seen one around for SpiderMonkey, would be interested in seeing one though.