The amount of source code files can affect the build time?

Hi I have joined an iOS development team about 3 month ago.

When I run the code, It takes too long time to build. Even though in the incremental build time too. It needs about 2 minutes to run every single time.

I have tried to find why it is too slow and I guess the amount of swift code file is.

There are 4,000 swift code files and the dependency is very complicated.

So... In a short, the number of source files can make build slower? Please save me! Thanks!

the number of source files can make build slower? 

for sure, but there is little you can do now (too much work to restructure probably).

Do all members of the team experience the same issue ?

What is your configuration :

  • Mac model
  • Memory available

Here is a discussion where slowlessness occurred with 150 files. May be worth reading even if some old parts are really outdated: https://stackoverflow.com/questions/28032506/how-to-handle-large-swift-project

I remember old days when it took 20 minutes to compile the code… We did take care to check the changes before starting compiling. 2 minutes is not that long if you don't try to build after each small change in code.

Generally, more source code to compile means there's more to the system to do. However, incremental builds should be fast and only compile the minimum amount required from changed files. To improve upon this, plesase see the article titled Improving the Speed of Incremental Builds. You'll also want to read Improving Build Efficiency with Good Coding Practices.

The amount of source code files can affect the build time?
 
 
Q