Discussion:
[fpc-devel] Testing compiler efficiency
J. Gareth Moreton via fpc-devel
2021-06-01 04:18:41 UTC
Permalink
Hi everyone,

I've found a potential area where the speed of the compiler itself could
be improved (while researching something unrelated!).  I have a quick
little question though.  What's the preferred way to test the compiler
speed and time how long it takes to build something in general?  In the
past I attempted to build the Lazarus source, but this tended to be
rather clunky.

Gareth aka. Kit
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
https://l
J. Gareth Moreton via fpc-devel
2021-06-02 11:21:29 UTC
Permalink
To explain, I've done some minor refactoring of the register tracking class that will provide a
speed boost when dealing with UpdateUsedRegs(TmpUsedRegs, p); and allow a descendant class to be
extended from it (I plan to experiment with running some peephole optimisations while the registers
are still virtual, hence the need for a register tracking class that supports them).

Currently I only have the refactored TUsedRegs class and I wanted to see how it affected the overall
compile time for a project, since while it will allow TmpUsedRegs to work faster due to its design,
it will likely cause the regular UpdateUsedRegs to run very slightly slower due to one or two
additional method calls.

From a pure refactoring standpoint, it removes the quirk of UpdateUsedRegs and
UpdateUsedRegsAndOptimize accessing a private field of TUsedRegs that it would otherwise not have
access to (a quirk of Pascal). I'l submit a patch for evaluation shortly - so far, it's tested
successfully on i386-win32, x86_64-win64 and arm-linux.

My laptop is in the repair shop currently, so I'm back to using exclusively Raspberry Pi-based
machines.

Gareth aka. Kit
Post by J. Gareth Moreton via fpc-devel
Hi everyone,
I've found a potential area where the speed of the compiler itself could
be improved (while researching something unrelated!).  I have a quick
little question though.  What's the preferred way to test the compiler
speed and time how long it takes to build something in general?  In
the
past I attempted to build the Lazarus source, but this tended to be
rather clunky.
Gareth aka. Kit
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
_______________________________________________
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
https://lists.freepasca

Loading...