Supposing I have multiple very long (large number of code lines) cpp file (one major including the others, which, it turn, include some), and given that (for a specific purpose) I would need only a small portions of the files (functions spread over multiple files), I wonder what would be the way to decrease the amount of time needed for compiling process.
Would compile time decrease if I just comment the unnecesarry code from each file? Or, is it better to extract the necessary part and to compile it separately? How would these two approaches differ?
Also, the header file inclusion might affect the compilation time, I guess (major cpp file includes other .cpp files, not a .h convention). So, is packing everything in one file more efficient in terms of compilation time? Perhaps including .h files is more efficient than including .cpp files?