-1

I have a really frustrating behaviour of Delphi Tokyo. I have moved from Delphi Xe7 and the other frustrating error (out of memory) is gone (or it seems till now), but a new one appeared.

When I update my project via the code repo, its often the case that I need to rebuild the whole thing. That wouldnt be that bad if it wasnt for the fact that it takes 2-3 hours for the whole application to rebuild (have it on 2 different machines, so its not a machine specific setting). In Xe7 I never had this problem. Its strage, when I pull the update everything seems normal, and I can resolve all my uses classes (witr Ctrl + left click on the class). But when I try to compile after couple seconds I get the random error message that a class, constant or whatever cannot be resolved (even though I can still click on it and resolve it). Then I need to build the bpl and it works again

Is there anything I can set inside RAD Studio to not make this happen? The problem also is, I didnt even figure out which update (to which of the included .bpls) it is that causes this problem

rimes
  • 761
  • 1
  • 8
  • 25
  • Ctrl+Click uses browsing path (debugger/code insight scope), while the compiler needs the library path (or the search path of the project). Maybe your paths are not set-up correctly, and a rebuild of your entire project group causes another project (package?) to make the dcu's available for your main application. Compiling only does the current application. Building can be Build Current or Build All. – GolezTrol May 20 '19 at 11:08
  • 2
    Btw, 2 to 3 hours? I got an application of close to a million lines that requires less than 2 minutes for a full build.. o.O – GolezTrol May 20 '19 at 11:10
  • @GolezTrol ditto here – Keith Miller May 20 '19 at 15:06
  • And here. In fact less than that. How long did the XE7 build take? – Gerry Coll May 21 '19 at 09:58
  • It took the same time in XE7 for the rebuild. But under XE7 I never had do rebuild the project after an update. The application has smt around 3 million lines. I would also be happy if there is a magic trick to make it build a lot faster :) – rimes May 21 '19 at 16:14
  • I have an application with 5 million lines of code and takes around 3-5 minutes to build (Full build). I believe something is very very wrong with your code base (if you are not using IDEFixPack, please do). BTW, I have the same issue (need to eventually rebuild the whole project in both Delphi 10.2.3 and 10.3.2) – Alexandre M Aug 05 '19 at 01:10

1 Answers1

1

I also have that problem sporadically, where only rebuilding helps in our 3 million lines codebase. Although I sadly cannot offer you a real solution for needing to rebuild, I can say that after clearing up Unit Dependencies it happened less and built faster. Some big Units still cause problems, but after resolving many circular Unit Dependencies and overall refactoring big Units into smaller ones it got significantly better.

You can for example use Delphi Unit Dependency Scanner to analyze your Dependencies and easily identify circular references.

I can also recommend taking a look at IDE Fix Pack which could speed up your build times.

IDE Fix Pack is a collection of unofficial bug fixes and performance optimizations for the RAD Studio IDE, Win32/Win64/Andoird-ARM compiler and Win32 debugger.

IDE Fix Pack is an IDE plugin for RAD Studio 2009-10.3 that fixes IDE bugs at runtime. All changes are done in memory. No files on disk are modified. None of your projects are modified or benefit from the IDE Fix Pack other than being compiled faster. Only the IDE gets the fixes and optimizations.

The performance optimizations let the IDE start faster, open projects faster, optimizes the compiler’s file search algorithm, makes CodeInsight, the actual compilation and the debugger faster. It also fixes some IDE, compiler and debugger memory leaks.

fastdcc applies the Compiler Speed Pack that is included in IDE Fix Pack on the command line compiler dcc32, dcc64 and dccaarm (XE6 and newer).

Our 3 million lines of code build in less than 2 minutes.

yberk
  • 78
  • 1
  • 7
  • thank you for the very useful hint. Actually I am in the middle of the refactoring. I guess the circular references where also the problem within XE7 for getting "out of memory" after compiling 2 times in a row – rimes May 23 '19 at 12:48
  • Just to keep you updated. With Pascal Analyzer I was able to reduce the build time from couple hourse to 1 minute 50 seconds. Thats really a huge imporvement, but the interesting part ist that the most gain was achived by reorganizing the units inside the uses clause (not by moving them from interface to implementation - that helped also - but reorganizing the units inside the implementation usese). Are there any guidelines for putting units inside the uses clause? – rimes Aug 22 '19 at 10:24