[fpc-devel] extending fpc for integration

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Sep 30 02:59:48 CEST 2010

Mattias Gaertner schrieb:

>> IMO most time can be saved by using the directory cache, instead of 
>> building another one in the compiler.
> I only tested reading/writing files. 
> In a second step the functions for file existence, age
> and size can be made overloadable. I doubt it will make fpc faster
> under Linux, but I guess under Windows it could be noticeable in some
> cases.
> The compiler spends some time parsing the ppu files.

Ah, I thought you mean source files.

>>> This would allow to compile without saving to disk, so the
>>> compiler could be used for quick syntax checks and similar tasks.
>> That's an old idea, still viable but never implemented.
>>> Note: Under Linux the speed up is hardly measurable. But
>>> maybe Windows can gain a bit.

My tests on Windows show no noticeable impact of file handling. Even 
closing and reopening files frequently doesn't add significantly to the 
execution time - most probably due to the OS file cache.

>> There's another issue with the .ppu files, that are used by the compiler 
>> to prevent excessive re-compilation of the same units. But recompilation 
>> can be forced, with some minor patching.
> I'm not sure what issue you mean.

When you want to use the compiler for syntax checks, a recompilation of 
the source code must be enforced. Otherwise the .ppu file is loaded, if 
exists, and no parsing occurs at all. The checks for up-to-date .ppu 
files is not bullet proof, as can be seen with errors that go away or 
don't go away in a recompilation.

>>> I changed a few calls to Assign/Reset/Close to use the TCFileStream
>>> (e.g. for the ppu reader) and added the possibility to define a custom
>>> TCFileStream class. An IDE can then redirect the file access.
>> The scanner already has a configurable file interface, but AFAIR only by 
>> global hooks, not on a per-file or per-application base (finput.pas: 
>> tdosinputfile...). No real problems, so far :-)

I didn't realize that you are talking about .ppu files, which IMO are of 
little use in the IDE.

> What global hooks do you mean?

Dunno about the handling of .ppu files.


More information about the fpc-devel mailing list