Sign in Join

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

Mailing lists / fpc-pascal / 2007-05

gcc beats fpc again

15 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Bisma Jayadi
Jonas Maebe
to Bisma Jayadi
Bisma Jayadi wrote
Obviously, some C programmers has done some more optimizations. :(

So it obviously means that gcc does not beat fpc (and that fpc did not beat gcc before), but simply that the C programs beat the Pascal programs (and that it was the other way around before that). It's just a game for programmers and fanboys who want to show of their skills and/or favourite compiler/language, but largely irrelevant as far as comparing different compilers is concerned (and even more so as far as comparing different programming languages is concerned).

Jonas

Daniël Mantione
to Bisma Jayadi: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all&xfullcpu=1&xmem=1&xl…
Daniël Mantione
to Bisma Jayadi

Op Wed, 23 May 2007, schreef Bisma Jayadi:

> No C programs have been submitted recently. It is probably the new broken > scoring system. Is Shootout using new scoring system? How did you know that?

See the long thread on the forum. It penalizes Pascal because we have a bad score for Chameneos; many languages, evade this now by not implementing Chameneos. Ironically, this is because most implementations use a flawed Chameneos implementation.

Perhaps we should submit a flawed implementation too.

Daniël

Bisma Jayadi
to Jonas Maebe: So it obviously means that gcc does not beat fpc (and that fpc did not beat gcc before),…
favourite compiler/language, but largely irrelevant as far as comparing different compilers is concerned (and even more so as far as comparing different programming languages is concerned).

Of course it's very relevant since they are all using same algorithms (please read http://shootout.alioth.debian.org/gp4/faq.php#implementp and http://shootout.alioth.debian.org/gp4/faq.php#contest). So, this is actually about compilers performance benchmark upon its implementation of the language.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

Jonas Maebe
to Bisma Jayadi
Bisma Jayadi wrote
Of course it's very relevant since they are all using same algorithms

No, because there are lot of ways to implement a single algorithm. Do you use ansistrings, shortstrings, arrays of char, or pchars? Do you use getmem or dynamic arrays? Do you use reference or value parameters (with or without "const")? Do you use virtual methods, function pointers or case statements?

Most of the discussions I've seen on irc about these benchmarks were at least about ways to tweak the Pascal code so it became faster (either because the compiler can then optimize it better, or because you are using lower level features which you probably wouldn't use when writing a production application rather than a website benchmark). This has little to do with how the compiler performs in real world situations.

Jonas

Daniël Mantione
to Jonas Maebe

Op Wed, 23 May 2007, schreef Jonas Maebe:

Show quoted text 16 lines
On 23 mei 2007, at 10:39, Bisma Jayadi wrote: > Of course it's very relevant since they are all using same algorithms No, because there are lot of ways to implement a single algorithm. Do you use ansistrings, shortstrings, arrays of char, or pchars? Do you use getmem or dynamic arrays? Do you use reference or value parameters (with or without "const")? Do you use virtual methods, function pointers or case statements? Most of the discussions I've seen on irc about these benchmarks were at least about ways to tweak the Pascal code so it became faster (either because the compiler can then optimize it better, or because you are using lower level features which you probably wouldn't use when writing a production application rather than a website benchmark). This has little to do with how the compiler performs in real world situations.

Sorry, but this is nonsense. If you care about speed in real world you do exactly the same: Tweak the code, use low level features, use shortstrings, and so on.

It might be true that in real world application you use more high level features, but that is because you value comfort higher than speed then. For performance benchmarks, this is irrelevant.

Daniël

Felipe Monteiro de Carvalho
to Jonas Maebe: No, because there are lot of ways to implement a single algorithm. Do you use…

It's obvious that the benchmark is flawed. This is also stated at their website. everyone knows that benchmarks are flawed

I'd say it's more like a game.

But, it's also interresting to see that in all benchmarks I've ever seen Perl, Python and Java are dozens of times slower and consumes dozens of times more memory then c or pascal software.

And it's also nice to see that pascal compares to c in speed. (The exact detail about if one is better in this benchmark or not is of course irrelevant). This means that if I ever need it, I can tweak my pascal code to be very fast.

Felipe Monteiro de Carvalho
Пётр Косаревский
to Felipe Monteiro de Carvalho

The one missing FPC program measures the speed and abilities of the regular expressions engine from language distribution.

Tonow FPC one has not enough abilities, but the engine may be written even exclusively in assembler or C: what matters is whether it is present in the distribution and has headers file.

So this test qualifies basic I/O operations and the distribution.

Christian Ulrich
to Bisma Jayadi: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all&xfullcpu=1&xmem=1&xl…

NO: C gcc has the first Place C is not Object oriented, FPC is Object oriented.
And g++ is behind fpc.

regards
Christian

Show quoted text 22 lines
Daniël Mantione
to Christian Ulrich

Op Wed, 23 May 2007, schreef Christian Ulrich:

NO: C gcc has the first Place C is not Object oriented, FPC is Object oriented.

Very few OOP is used in the Pascal implementations, so Pascal and C are on equal grounds here.

Daniël

Christian Ulrich
to Daniël Mantione
Very few OOP is used in the Pascal implementations, so Pascal and C are on equal grounds here.

musnt the memory manager included if only few oo stuff is included ? why g++ is soo mutch slower than gcc if so few oo stuff is used ??

pure c is no higher level laguage for me. asm is not soo mutch more complex. pascal oo or not has so mutch more features its no compare.

Daniël Mantione
to Christian Ulrich

Op Wed, 23 May 2007, schreef Christian Ulrich:

Show quoted text 5 lines
> Very few OOP is used in the Pascal implementations, so Pascal and C are > on equal grounds here. > musnt the memory manager included if only few oo stuff is included ?

? The heap manager is always in the exe; it cannot be smarlinked away.

You can use the heap manager without using oo, so I don't understand this question.

why g++ is soo mutch slower than gcc if so few oo stuff is used ??

g++ implementations use C++ features. OOP is just one of them. Many use templates, or operator overloading, and some use OOP.

pure c is no higher level laguage for me. asm is not soo mutch more complex. pascal oo or not has so mutch more features its no compare.

That is a rather limited view you have; OO is not equal to a high level language. and using Pascal does not necessarily mean you use OO.

Daniël

Marc Weustink
to Daniël Mantione: Op Wed, 23 May 2007, schreef Bisma Jayadi: See the long thread on the forum. It penalizes…
Daniël Mantione wrote 13 lines
Op Wed, 23 May 2007, schreef Bisma Jayadi: >> No C programs have been submitted recently. It is probably the new broken >> scoring system. > Is Shootout using new scoring system? How did you know that? See the long thread on the forum. It penalizes Pascal because we have a bad score for Chameneos; many languages, evade this now by not implementing Chameneos. Ironically, this is because most implementations use a flawed Chameneos implementation. Perhaps we should submit a flawed implementation too.

Maybe I can find my initial implementation again. IIRC it was about 10 times faster ;-) (or was it 5)

Marc