When does whitespace impact on performance?

This is something I've always wondered about, so here goes.

When writing code, I was/am taught to space out lines, comment them, etc... to improve the readibility (as I guess most of us are). I obviously don't see this as any kind of problem, but it got me thinking, if all of this whitespace and commented sections are being ignored by the compiler/interpreter or whatever else, how much does this impact on the its performance?

Admittedly, I don't know a lot about how a compiler operates - only the basic concepts. However, I have a fair idea that for one to be able to "ignore whitespace", it would first need to identify it (at least), and that takes work, and therefore time.

So then I thought, what about whitespace or comments at extreme levels? Say, millions or billions of sections of them?

I guess the question I'm asking is: At what point (ie. extreme level) will ignored sections of code impact a compiler's/interpreter's ability to produce a timely result and therefore impact on a user's experience?

Thanks.

5
задан daniel 11 March 2011 в 01:08
поделиться