Delphi: How to organize source code to increase compiler performance?

前端 未结 14 2192
一整个雨季
一整个雨季 2020-12-13 13:14

I\'m working on a large delphi 6 project with quite a lot of dependancies. It takes several minutes to compile the whole project. The recompilation after a few changes is so

14条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 14:15

    We had the same (or similar) problem. I of our package has compilation Time about 12 min. After changes, now we have moved to 32 sg.

    After many tests we found that the "problematic situation" was the following: In a single package:

    • The A unit uses a large number of units: U1, U2, U3, U4, ... U100 (Uses of Interface) in the same package. This is an important unit that centralizes all the initialization work.

    • All units of the package, U1, U2, U3, .., U100 uses unit A (use of implementation)

    This "circular reference" does not give compilation errors because the USES are different, but caused a large compile-time.

    SOLUTION: Eliminate the reference to each unit, U1, U2, U3 ,...., U100 in the A Unit.

    Now, A unit use a large number of units: U1, U2 ,...., U100, but the units U1, U2 ,..., U100, does not use the unit A.

    After this change the compile-time is down drastically.

    If you have a similar situation, you can try this.

    Excuse for my bad english.

    Greetings.


    Neftalí -Germán Estévez-

提交回复
热议问题