Hi,

On Wed, 31 Aug 2016, Anthony Walter wrote:

> I'm not too familiar with LLVM so I'll ask, is it at all likely that an
> LLVM compiler would produce significantly better/faster optimizations
> than FPC as it stand currently? What range would be talking about 100%
> faster? Less? More?

We just had a C vs. Rust vs. FPC showdown with a colleague at work. He
wrote a small tight loop example with float maths, we ported it to three
languages, and we looked at the results.

C (clang/llvm) came first, Rust was closely behind, FPC was about 2x as
slow as Rust (which is llvm based as well). But it turned out, that if I
did some hand optimization by moving unchanging parts of some expressions
outside the innermost loop, plus enabled SSE42 for floating pointinstead
of x87, the speed matched the Rust implementation (which is again, LLVM
based). And no, no inline assembly was involved.

The big tricks in compilers are still Common Subexpression Elimination and
Single Static Assignment. Especially the later. Only if we could have a
good one of that...

But again, as Jonas said, this was an artificial benchmark of an abusive,
badly written tight loop, and with thousands of iterations, we're talking
about the ms range for results, on modern CPUs.

Charlie
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to