Discussion:
[fpc-devel] The 15k bounty: Optimizing executable speedforLinux x86 / LLVM
J. Gareth Moreton
2018-12-04 20:24:07 UTC
Permalink
At the moment I'm trying to fix some Linux bugs.  When I compile Lazarus
with it, I get about a 5% speed increase for -O1 and a 15% speed increase
for -O3, but someone else reported a 2% slowdown for -O2 on their own test
project.  Either way, I hope my fundamental theory is sound... reducing
the number of code passes... and I can convince Florian that the possible
increase in maintenance difficulty is worth the performance gain.  If
that's successful, then I'll port the relevant code over to i386.

When it's totally stable, I'll definitely run your own project through it
to see what we get.  There are other little speed savings that can be made
here and there that add to the running total.  Most of it is simple
refactoring.

For your bug report, I had a look at the Intel® 64 and IA-32
Architectures Software Developer’s Manual to check on some of the
assembler routines, and the ones where LEA contains an immediate operand
are actually invalid.  My guess though is that the immediate was being
converted into a reference that doesn't contain any registers.  I'm not
sure if and how an assembler should support that though, even if it's
possible to represent the arrangement in raw machine code.  Something for
investigation, that's for sure.

Gareth

On Tue 04/12/18 19:29 , Simon Kissel ***@nerdherrschaft.com sent:
Hi Gareth,
A regression like this is quite serious. I'd recommend opening a
bug report with a reproducible case so we can investigate and hopefully
fix it within the day.

created a test project, and opened two tickets:

https://bugs.freepascal.org/view.php?id=34646 [1]
https://bugs.freepascal.org/view.php?id=34647 [2]
At the moment I'm experimenting with increasing the speed of the
optimizer for x86_64, and then porting to i386 when it's proven
successful. Having teething problems though!
Sounds great. I wish more of our products had 64bit CPUs...

What's the speed-up you are seeing on my test project so far?

Best regards,

Simon

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [3]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[4]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
J. Gareth Moreton
2018-12-06 22:16:03 UTC
Permalink
Hi Simon,

Where are your test projects located again? I figure they might make for
good timing metrics even if my overhaul is only for x86_64 currently.  If
it's successful and the other developers approve, then I can port it to
i386 where it counts.

Alternatively, if you want to test out the changes yourself, everything
you need is over at this ticket:

https://bugs.freepascal.org/view.php?id=34628

Thanks for your motivation with the bounty (even though I just want to
improve the language I love!)

Gareth aka. Kit

On Tue 04/12/18 19:29 , Simon Kissel ***@nerdherrschaft.com sent:
Hi Gareth,
A regression like this is quite serious. I'd recommend opening a
bug report with a reproducible case so we can investigate and hopefully
fix it within the day.

created a test project, and opened two tickets:

https://bugs.freepascal.org/view.php?id=34646 [1]
https://bugs.freepascal.org/view.php?id=34647 [2]
At the moment I'm experimenting with increasing the speed of the
optimizer for x86_64, and then porting to i386 when it's proven
successful. Having teething problems though!
Sounds great. I wish more of our products had 64bit CPUs...

What's the speed-up you are seeing on my test project so far?

Best regards,

Simon

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [3]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[4]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:

Loading...