1

I am using Visual Studio IDE for a big C++ project with million lines of codes and hundreds of files.

I notice that each time i build the solution after some small changes across multiple files, it takes more and more time at each subsequent build.

Once i rebuild the solution and though rebuilding took quite some time, each subsequent build is much faster than previous build pre rebuild.

I made the hypothesis that may be compiler puts multiple obj files into one. Each time we make a change and build solution, it has to break big objs into smaller one and hence increasing more number of obj files. This way linking would be slow because of more and more obj files added.

However, i could not find any support for my fancy thinking.. and of course could not prove it before my colleagues.

What is the reason for the slowness build-after-build and why it becomes fast after rebuilds ?

Ashish Negi
  • 5,193
  • 8
  • 51
  • 95
  • maybe http://stackoverflow.com/a/14641474/420446 – willll Aug 05 '14 at 13:17
  • Native C++ or managed? In native I would suspect that it's most likely due to the pre-compiled header. Try deleting/rebuilding just that and see if you get the same effect. I've never worked with managed C++. – SingleStepper Aug 05 '14 at 13:26
  • Native cross platform cpp.. and @willll it happens all the time, not just after some power break. – Ashish Negi Aug 06 '14 at 06:24
  • we have the same problem rebuilding take 10 min time building with small changes in header files take 30 minutes – jalal sadeghi May 16 '18 at 08:11

1 Answers1

0

I don't have an answer to why is this happening but I can tell you that obj files do not get fused together.

Thiscord
  • 1
  • 2