Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-10

Re: The 15k bounty: Optimizing executable speed forLinux x86 / LLVM

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

I would argue how such a bounty would be
rewarded here because overall performance
gains have been done by multiple
submitters. For example, I've submitted a
number of improvements to the optimiser to
produce both smaller and faster machine
code.

And unfortunately not many of us have
access to Kylix.

Saying all that though, any improvement to
FPC is greatly welcomed.

Gareth aka. Kit

On Thu 25/10/18 08:38 , Michael Van
Canneyt sent:

Show quoted text 9 lines
On Sat, 20 Oct 2018, Simon Kissel wrote: > - Make Exception handling, TLS etc use

the

Show quoted text 6 lines
infrastructure that > libpthread is providing TLS is handled already by libpthread. I

doubt you will gain much there.

However, Exception handling is a

problem. There are 2 possible ways ahead:

- DWARF exception handling as mentioned

by Sven.

- Port SEH to be cross platform, this is

the approach as taken by Kylix.

Kilyx has a small rtlunwind library

that mimics the needed run-time

Show quoted text 6 lines
functionality offered by Windows. Conceivably, it can be duplicated. wine

probably has such a library which

Show quoted text 6 lines
can be used as an inspiration. The needed compiler infrastructure for

SEH already exists, so this is most

Show quoted text 8 lines
likely the fastest way to proceed. Michael..

Reply by email

Michael Van Canneyt
to J. Gareth Moreton
J. Gareth Moreton wrote 7 lines
I would argue how such a bounty would be rewarded here because overall performance gains have been done by multiple submitters. For example, I've submitted a number of improvements to the optimiser to produce both smaller and faster machine code.

I think that specific improvements should be specified, and a bounty for each of these improvements should be specified, instead of an overall bounty.

Michael.

Reply by email

J. Gareth Moreton

To add my two pence to this:

Low-level optimisation is my personal speciality.  Currently a lot of what I do is on small savings within the peephole optimizer on x86 systems.  Generally the result is that the compiler runs slightly more slowly, but the final binary runs a bit more efficiently - for example, replacing integer divisions by a constant with multiplications.

It's not as important as improving node generation and the like, but every little helps.  In the meantime, I'm seeing if it's possible to minimise the number of passes that the optimiser makes - currently it's at least 4 per code block when -O3 is specified... pre-peephole, pass 1 (which is repeated until there are no more critical changes), pass 2 and post-peephole).  This may not amount to anything, but I tend to experiment a lot.

Part of my incentive is that I like to design games and am also an amateur mathematician, both fields that can benefit from speed gains, so if I can make Free Pascal into something that is suitable for such tasks, then my life is complete!

Gareth aka. Kit

Reply by email

Ben Grasset
to J. Gareth Moreton: To add my two pence to this: Low-level optimisation is my personal speciality. …

On Sun, Oct 28, 2018 at 12:40 AM J. Gareth Moreton <

Show quoted text 7 lines
wrote: Part of my incentive is that I like to design games and am also an amateur mathematician, both fields that can benefit from speed gains, so if I can make Free Pascal into something that is suitable for such tasks, then my life is complete!

That's also more broadly kind of part of what I was getting at. Basically I was just trying to point out that whether or not it was originally within the scope of the project, FPC IS nowadays being used for various things that do in fact require the highest level of performance possible. Just look at stuff like the Castle Game Engine, or at any of the games/demos that have come out of the contests on the Lazarus forums.

The idea that "real world use cases" means "boring database applications and pretty much nothing else" with regards to FPC nowadays is just objectively wrong. I'd imagine that a large percentage of the people who use FPC now don't actually care at all about stuff like FCL-DB, and will never use it.

Reply by email