Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: Paul Robinson Newsgroups: comp.compilers Subject: Statistics on compiling the Free Pascal compiler for Win32 Date: Tue, 17 Jan 2012 06:06:44 -0800 (PST) Organization: Compilers Central Lines: 68 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-01-033@comp.compilers> Reply-To: Paul Robinson NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1326817215 98468 64.57.183.58 (17 Jan 2012 16:20:15 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Tue, 17 Jan 2012 16:20:15 +0000 (UTC) Keywords: Pascal, performance Posted-Date: 17 Jan 2012 11:20:15 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:432 I wanted to actually test that the Free Pascal compiler - as originally written - would compile on my machine. Note for comp.compilers readers, the Free Pascal compiler is self-hosting, it is written in its own language, unlike, say, the GNU Pascal Compiler which is a front-end for the GNU Compiler Collection (the C++ compiler) and the GNU Pascal Compiler is written in C. Compiling using the DOS IDE, I brought up the file PP.PAS, declared it as the primary file, for compiler switches, I entered into the IDE the following: Win32 I386 cpu32bitaddr Each time it did not find a Pascal Unit I cheated, looked for the file and copied it into the 'compiler' directory rather than try to set the directories in the IDE because I was having trouble or doing something wrong and it didn't find the files. (This was mostly a demonstration to see how long it takes, not a 'real' compile or I'd have been much more careful.) So then, once it stopped complaining, I had it do a 'build' to do a complete scratch build of the compiler. This is on a Windows XP Professional 32-Bit OS on a 64-bit machine - Dell Optiplex 760 - 2.2 GHZ processor, 3 GB of ram and more than 1.4 terabytes of free disk space. This machine was bought as refurbished about 18 months ago for about $200 and had the extra disk and memory added later, adding about another $200 to its price (I got a good deal on a 2tb drive for $89; prices went up nearly 100% about 6 months later.). A very nice couple of notes about this article from the people at Free Pascal pointed out I made a mistake: if I was compiling PP.EXE against itself at the DOS level, I didn't tell the compiler to create a different named executable file because (obviously) it wouldn't be able to replace itself while I'm running it! They also pointed out a few other things about how to do this more efficiently. But the whole point of this story is just to give a general impression of self-compiling this compiler. This was the result, I've copied off the results box shown by the FPIDE: One warning: aasmtai.pas(396,11) Warning: Constructor should be public Main file: C:\..\compiler\pp.pas Done. Target: Win32 for i386 Line number: 225 Total lines: 261804 Used memory: 417612K Allocated memory: 25792K Total errors: 0 Compile time: 13.9s Compile successful: Press any key From the directories it creates 203 PPUs (the internal object library file used by Free Pascal to store Units). The compiler itself is 11,727,679 bytes. I deleted all ppu files and the exe file and re-ran build, and this time it took exactly 14 seconds. Typing its name at the DOS prompt causes it to list all of the options and quit, indicating it is operational. In short, it compiled a program containing a total of about 262,000 lines of Pascal code in 14 seconds, which comes out to a compilation rate of around 1.12 million lines of code per minute. So basically I, just like anyone else, for about the same amount as an ordinary person's salary for a week, can own a machine that runs basically at what was mainframe speed levels a few years ago. The Lessons of history teach us - if they teach us anything - that no one learns the lessons that history teaches us.