At a recent event, a person mentioned he had problems with the debugger with a very large unit (as you can see in the questions).

Although I'm not sure why someone would ever want to have over 64,000 lines of Delphi code in a single unit (a single file, for the non-Delphi developers out there), I was puzzled about the request. So I wrote a very large unit like that. Well, that's not entirely true, I wrote a program I used to write a large unit, with 20,000 functions for adding numbers (all with the same signature). Than I added the unit to the same program, called a function, and palced a breakpoint. In fact the developer asking the question was mentioning debugging problems. Here is the large unit in the debugger, stopped at line 81,732 (out of 120,011 lines):

I have not tried to compile and run the same application in Delphi 2007 (the version against which the problems was reported), but 2010 seems to handle it. Yes, opening the unit is not terribly fast, as the IDE has to parse it. As an experiment I tried to create and compile a unit with 200,000 similar functions, but the compiler started using the system memory and CPU at a very high rate and the compiled lines count after a while was moving versy slowly... so eventually I gave up compiling a unit with over a million lines of source code.

My original question remains, though. Why would one developer have such a large unit? Which are the largest units (in terms of lines of source code) you have?