This question comes to the mind of every programmer and is often asked in interviews. The answer is simple.
Consider a C program. You have several functions, classes, structures etc., or modules for short. During the first compilation, each module is parsed and tokenized. This takes a longer time. After this if changes are made in any module, it is recognized by the compiler. In the next compilation, only the ones that have been changed are parsed.
Hence subsequent compilations always take lesser time than the first due only to the reduced volume of code that needs to be compiled.
Cheers!
Consider a C program. You have several functions, classes, structures etc., or modules for short. During the first compilation, each module is parsed and tokenized. This takes a longer time. After this if changes are made in any module, it is recognized by the compiler. In the next compilation, only the ones that have been changed are parsed.
Hence subsequent compilations always take lesser time than the first due only to the reduced volume of code that needs to be compiled.
Cheers!
No comments:
Post a Comment