The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,418 other followers

Optimized Pascal compilation time | Fredrik Haglund’s blog

Posted by jpluimers on 2018/08/14

Long uses lists especially of units circularly referencing each other are killing for compiler performance both in CPU and memory consumption.

To solve it:

Ingredients

  • ICARUS – a free tool from the maker of Pascal Analyzer. [WayBackhttp://www.peganza.com/products.htm. Icarus parses Delphi or Borland Pascal source code and generates a Uses Report. This report will help you remove unneeded units from your uses lists. You will also know which units that can be moved from the interface uses list to the implementation uses list.
  • Uses Cleanup Tool – by Oleg Zhukov [WayBackhttp://cc.borland.com/Item.aspx?id=23199.

Step-by-step

  1. Run ICARUS on your delphi project to get a report of which units depends on each other.
  2. Input this report in the Uses Cleanup tool to automatically update all uses-clauses in your source code.
  3. Delete all DCU-files and recompile.

Source: [WayBackOptimized Pascal compilation time | Fredrik Haglund’s blog

Edit

Bit-rot galore!: Since Fredrik published his article, some links have vanished, so they are invalid in the above quote as well:

Uwe Raabe was the first to notice on [WayBack] G+ Long uses lists especially of units circularly referencing each other are killing for compiler performance both in CPU and memory consumption… – Jeroen Wiert Pluimers – Google+ that the Uses Cleanup Tool by Oleg Zhukov can now be downloaded from [WayBackFiles as [WayBackUsesCleanupceaf.zip.

Several people suggest using cnPack in the above G+ thread, but [WayBacktheir Delphi parser is far behind [WayBack] Delphi AST.

Cleaning uses lists is a tough thing, it very much depends in getting the dependencies really right, then interpreting them correctly.

–jeroen

7 Responses to “Optimized Pascal compilation time | Fredrik Haglund’s blog”

  1. FWIW, Try this for the Uses Cleanup Tool: http://www.olegzhukov.com/UsesCleanupceaf.zip?fileticket=R__cxggc2OA%3d&tabid=73&mid=402

  2. IL said

    Unfortunately, both last version of ICARUS and its successor Peganza Pascal Analyzer Lite produce “USES.txt file corrupt” error for D7 project in Uses Cleanup Tool.
    Time to refresh grammar parser code in UCT or switch it to Delphi AST (;

  3. EMB said

    Cnpak has an uses cleaner too…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: