Delphi:如何组织源代码来提高编译器性能? [英] Delphi: How to organize source code to increase compiler performance?

查看:128
本文介绍了Delphi:如何组织源代码来提高编译器性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个大型delphi 6项目,有很多依赖。编译整个项目需要几分钟时间。几次更改后的重新编译有时要长得多,因此可以更快地终止Delphi,清除所有dcu文件并重新编译所有内容。

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 sometimes much more longer so that it is quicker to terminate Delp erase all dcu files and recompile everything.

有人知道一种识别方法,是什么使得编译器越来越慢?任何提示如何组织代码以提高编译器性能?

Does anyone know a way to identify, what makes the compiler slower and slower? Any tips how to organize the code to improve compiler performance?

我已经尝试过以下操作:

I have already tried following things:


  • 显式地包括dpr中的大多数单元,而不是依赖于搜索路径:

  • 使用命令行编译器dcc32:itn

  • 尝试看看编译器做了什么(使用SysInternals的ProcessExplorer):显然它大部分时间运行一个名为KibitzGetOverloads的函数。但我不能对这些信息做任何事情。

EDIT, strong>

EDIT, Summary of the answers until now:

在我的案例中最好的答案:

The answer that worked best in my case:


  • 清除未使用的单元引用来自 cnpack 。它几乎自动清除了超过1000个引用,使冷编译大约快两倍。 (冷编译=在编译之前擦除所有dcu文件)。 它从编译器获取引用列表。因此,如果您有一些{$ IFDEF}检查所有配置仍在编译。

  • The function "Clean unused units references" from cnpack. It almost automatically cleaned more than 1000 references, making a "cold" compilation about twice faster. ("cold" compilation = erase all dcu files before compiling). It gets the reference list from the compiler. So if you have some {$IFDEF } check that all your configurations still compile.

尝试:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆