A funny yet crazy extreme test on Delphi 7 compiler
- From: "Qi" <kbasm.com@xxxxxxxxxxxxxxxxx>
- Date: 25 Jan 2008 00:23:24 -0700
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!
.
- Follow-Ups:
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- From: DS
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- From: Alexandre Machado
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- From: John Stoneham
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- From: Q Correll
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- From: Dennis Landi
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- From: Peter Zemtz
- Re: A funny yet crazy extreme test on Delphi 7 compiler
- Prev by Date: Re: A Tale of Two Memory Managers (long)
- Next by Date: Re: Is dbExpress a dead end?
- Previous by thread: A Tale of Two Memory Managers (long)
- Next by thread: Re: A funny yet crazy extreme test on Delphi 7 compiler
- Index(es):
Relevant Pages
|