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.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to