Hello,
I have spent some time to profile the compiler using callgrind, and was able to improve its speed by about 20%. Attached are the changes that I made to the sources.
Some comments:
daopt386.pas: original code was calling fpc_varset_load (twice), fpc_varset_create_element and fpc_varset_add - all for just setting a single bit! I wonder if that can be done slower at all :)
ppu.pas: probably the commented out block must be appropriately $ifdef'ed. But at least on i586 System.Move is optimized so well that always calling it makes tppufile.readdata about twice faster.
fppu.pas: The design of compiler messaging (load and format messages _before_ checking verbosity level) is good for errors and warnings, but is a waste of time for reporting several thousands tried and used units. Therefore I added verbosity checks before any attempts to output something.
cfileutils.pas: Rewrote FixPath() and FindFile() to exclude implicit AnsiString temp vars and so on.
cmsgs.pas: used ShortString version of StrPas() to avoid conversions.
I hope that at least some of this patching can be used in mainstream :)
Best regards,
Sergei
