[fpc-devel] Comparison FPC 2.6.2 - Delphi 7
    Michael Van Canneyt 
    michael at freepascal.org
       
    Sun Mar  3 01:23:10 CET 2013
    
    
  
On Sat, 2 Mar 2013, Graeme Geldenhuys wrote:
> On 2013-03-02 10:28, Michael Van Canneyt wrote:
>> We can say for sure that the fact you use .pas as filename extension
>> will cause FPC to do twice the number of stat() calls, because .pp is
>> searched first...Logical therefore that the IO is slower.
>
>
> Second time I hear this this week. Can we (in our own copies of FPC)
> change this to search .pas first? If so, where in the source?
Search for sourceext and pasext.
fppu.pas:           Found:=UnitExists(sourceext,hs);
fppu.pas:              Message1(unit_t_unitsearch,ChangeFileExt(sourcefn,sourceext));
fppu.pas:            fnd:=FindFile(ChangeFileExt(sourcefn,sourceext),'',true,hs);
globals.pas:       sourceext  = '.pp';
options.pas:      if FileExists(inputfilepath+ChangeFileExt(inputfilename,sourceext)) then
options.pas:        inputfilename:=ChangeFileExt(inputfilename,sourceext)
scanner.pas:               found:=findincludefile(path,ChangeFileExt(name,sourceext),foundfile);
Be careful when changing this, because the compiler will then also search for rtl/fcl/package 
source files with different names, which may result in nasty surprises.
Michael.
    
    
More information about the fpc-devel
mailing list