A funny yet crazy extreme test on Delphi 7 compiler




This is my blog post, it should be interesting to also
discuss here.


See how Delphi compiles very huge source file!

The test environment:
Hardware: really poor. Pentium 4, maybe 2.4G HZ? Don't know.
It's at least 3 or 4 years old! The RAM is 1G.
Software: Delphi 7, I use the command line tool dcc32 to
do the compile. OS is Win2000, with some memory consuming
program running, such like MS Outlook, Eclipse, etc.

The test project:
A project with a major source file names TestCase.pas.
TestCase.pas has 121263 (120K) lines of code, and the
file size is more amazing, 62,570,543 bytes (59.6M).
You can see the average line length is about 500 characters,
it's very long.

The content of TestCase.pas:
That file is major generated by a Perl script, which is
used to test my another project. It mainly includes various
function (global and instance functions) with different count
of parameters.
The parameter count range is from 0 to 999. Note, the maximum
parameter count is 999, so a lot! All of the parameters type
is Integer, no strange parameters such like Variant are used.
Each function is in 3 calling conventions (Delphi register call,
stdcall, and C++ cdecl) and in two versions, one is global
function, another is object function (class member).
So there are around 1000 * 3 * 2 = 6000 functions in that source
file. Also they are a lot of functions.

The test result:
The message reported by dcc32 is,
TestCase.pas(121263)
other trivial files
125579 lines, 1019.62 seconds, 16292320 bytes code, 70269 bytes data.

And here is some other data: the file size of TestCase.dcu is
around 35M, the destination exe file size is around 16M.

The result is amazing according to following points:
1, Delphi can handle so large source file. I suspect (but not verify)
many compilers can't process a source file with 60M size or 120K
lines of code.

2, Delphi can compile crazy functions with 999 parameters. In the
real life, no one will write a function with so many parameters,
but at least it's proving Delphi's capability. 9999 parameters
are also OK. 99999 parameters cause dcc32 crash, but who cares!
Nobody needs a function with more than 10K parameters.

3, The exe compiled by Delphi works quite OK. So the huge file
doesn't drive Delphi crazy. :-)

4, The peak memory used by dcc32 is about 250M. It's not so much
considering a 60M source file.

5, The compiling time is amazing. 1000 seconds is only about 16
minutes, it's really fast enough. I expect a C++ compiler may
need several hours to compile that huge file.

Conclusion:
Though this test is only a derived work of testing my another
project, we have already seen the capability of processing huge
source files in Delphi. It's amazing, and great!

.



Relevant Pages

  • Re: A funny yet crazy extreme test on Delphi 7 compiler
    ... The RAM is 1G. ... A project with a major source file names TestCase.pas. ... Delphi can compile crazy functions with 999 parameters. ...
    (borland.public.delphi.non-technical)
  • Re: Build and Install package from a command line
    ... Small question how to make DCC32 to see BPG settings - project group ... now with Delphi 2005 support ... use dcc32.exe to compile your dpk ... > JVCL Coordinator ...
    (borland.public.delphi.non-technical)
  • Re: Install DevExpress components in Delphi 2006
    ... How can I use them in Delphi 2006? ... try to compile using Delphi 2006's dcc32 I get too many errors. ... ask the DeveloperExpress support (support atsymbol devexpress ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: I really hate .NET especially inside Delphi
    ... Delphi.NET terms this is a package (yeah, yeah, I don't know why ... a BPL it will compile to a dll, ... Mainly because I couldn't get the output as I wanted it to be and I simply got used to the ease of namespaces and multi pass compiling in the time before Delphi learned .Net. ...
    (borland.public.delphi.non-technical)
  • Re: Looking for a free basic compiler for DOS
    ... mother of an ide file - and created separate source files for each SUB ... big to compile in one bc step. ... the source for all the SUBS in the same source file. ...
    (comp.lang.basic.misc)