3 ms·
The line in question is a comment, not a call to printf.
by Arnavion 5y ago
The line in question is a comment, not a call to printf.
- dotancohen 5y agoYou don't know what the compiler is doing behind the scenes before it figures out that is a comment. For instance, it might parse the entire function body for printf() and if it finds it then loads some library, only then getting around to actually parsing the function line by line. Think of Javascript hoisting - only dumber.
- Jenda_ 5y agoThere was a case, which I cannot find now, where the compiler decided whether the function is small enough to inline based on its source code size, including comments. Edit: found it https://medium.com/@c2c/nodejs-a-quick-optimization-advice-7353b820c92e https://medium.com/@c2c/nodejs-a-quick-optimization-advice-7... https://news.ycombinator.com/item?id=18170499 https://news.ycombinator.com/item?id=18170499 Edit 2: the medium.com URL redirects to a non-existent domain when I'm not signed into a Medium account (wtf). http://web.archive.org/web/20151222072514/https://top.fse.guru/nodejs-a-quick-optimization-advice-7353b820c92e?gi=1e133d2b2783 http://web.archive.org/web/20151222072514/https://top.fse.gu...
- Arnavion 5y agoThat may well be the case, but it is not what the comment I replied to was talking about.