Sign in Join

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

Mailing lists / fpc-other / 2011-05

Which programming language is fastest?

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Isaac Gouy

http://lists.freepascal.org/lists/fpc-pascal/2011-May/028931.html

1) The blog post seems obsessed with rankings - "From the top five at 2007 to the 14th on 2011" - as-though rankings were shown on those benchmarks game web pages, and as-though rankings are the most informative basis for comparing program performance.

Those benchmarks game web pages do not show a ranking number - in a deliberate effort to discourage exactly the kind of bogus comparison made in the blog post.

2) The blog post states - "C# and Java, both interpreted languages".

No. The standard implementations of C# and Java, the implementations of C# and Java that are shown on the benchmarks game website are not just byte code "interpreters".

The benchmarks game web page for Java even explains when the Java VM compiles from byte code -

http://shootout.alioth.debian.org/u32q/java.php#about

3) The blog post shows summary statistics from one of the 4 sets of up-to-date measurements shown on the benchmarks game website - but never mentions that those measurements were made on a quad-core machine.

The blog post never mentions that several of the C++ programs were written to use multi-core but the corresponding Free Pascal programs were not - and that has increased the performance difference.

The blog post could have avoided that confusion by examining measurements where the programs were forced to use just one core.

Better still, just compare the C++ and Free Pascal program performance directly -

http://shootout.alioth.debian.org/u64/pascal.php

Reply by email

Mattias Gaertner
to Isaac Gouy
[...] 3) The blog post shows summary statistics from one of the 4 sets of up-to-date measurements shown on the benchmarks game website - but never mentions that those measurements were made on a quad-core machine. The blog post never mentions that several of the C++ programs were written to use multi-core but the corresponding Free Pascal programs were not - and that has increased the performance difference.

No.
I did some tests myself and came to similar results. For example the knucleotide test in c++ runs in about 3 seconds on my quad core and about 10seconds on a single core. The fpc program needs 50secs. The times shown are for single cores.

Show quoted text 5 lines
The blog post could have avoided that confusion by examining measurements where the programs were forced to use just one core. Better still, just compare the C++ and Free Pascal program performance directly - http://shootout.alioth.debian.org/u64/pascal.php

Mattias

Reply by email

Isaac Gouy
to Mattias Gaertner
Mattias Gaertner wrote 7 lines
No. I did some tests myself and came to similar results. For example the knucleotide test in c++ runs in about 3 seconds on my quad core and about 10seconds on a single core. The fpc program needs 50secs. The times shown are for single cores.

1) Please go to the blog post, move your cursor over one of the data tables, and click.

2) Notice that the web page you're taken to has the title - "Ubuntu : Intel® Q6600® quad-core"

3) Click on the "C++ GNU g++" link

4) Scroll down (or page search) to "Step 3" and notice that k-nucleotide shows

C++ GNU g++ 13.03 CPU secs, 3.84 Elapsed secs, 83% 81% 94% 84% ≈ CPU Load

5) Change the comparison to Pascal Free Pascal and notice there's no difference between CPU secs (66.26) and Elapsed secs (66.29) for the Pascal program

http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=gpp&lang2=fpascal#faster-programs-measurements

Reply by email

Isaac Gouy
to Mattias Gaertner: On Mon, 9 May 2011 14:27:51 -0700 (PDT) No. I did some tests myself and came to similar…

--- On Mon, 5/9/11, Mattias Gaertner wrote:
-snip-

The times shown are for single cores.

fyi This is the x86 single core "Which programming languages are fastest?" page

http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php

fyi This is the x86 single core C++ :: Free Pascal page

http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=gpp&lang2=fpascal

Reply by email

Mattias Gaertner
to Isaac Gouy: 1) Please go to the blog post, move your cursor over one of the data tables, and click.…
Show quoted text 30 lines
--- On Mon, 5/9/11, Mattias Gaertner wrote: > No. > I did some tests myself and came to similar results. For > example the > knucleotide test in c++ runs in about 3 seconds on my quad > core and about 10seconds on a single core. The fpc program > needs 50secs. > The times shown are for single cores. 1) Please go to the blog post, move your cursor over one of the data tables, and click. 2) Notice that the web page you're taken to has the title - "Ubuntu : Intel® Q6600® quad-core" 3) Click on the "C++ GNU g++" link 4) Scroll down (or page search) to "Step 3" and notice that k-nucleotide shows C++ GNU g++ 13.03 CPU secs, 3.84 Elapsed secs, 83% 81% 94% 84% ≈ CPU Load 5) Change the comparison to Pascal Free Pascal and notice there's no difference between CPU secs (66.26) and Elapsed secs (66.29) for the Pascal program http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=gpp&lang2=fpascal#faster-programs-measurements

Yes, sorry, if I confused you.
I just wanted to point out, that the times are
correct and that the fpc programs are often
several times slower compared to the c and java versions.

I wonder why the Perl median dropped from 46 to 137.

Mattias

Reply by email

Jonas Maebe
to Isaac Gouy: 1) Please go to the blog post, move your cursor over one of the data tables, and click.…
Isaac Gouy wrote 11 lines
--- On Mon, 5/9/11, Mattias Gaertner wrote: > No. > I did some tests myself and came to similar results. For > example the > knucleotide test in c++ runs in about 3 seconds on my quad > core and about 10seconds on a single core. The fpc program > needs 50secs. > The times shown are for single cores. 1) Please go to the blog post, move your cursor over one of the data tables, and click.

[snip]

I think all Mattias was trying to say is that even if you compare the single core C++ version to the single code Pascal version the C++ version is still 5 times faster than the Pascal version (i.e., the speed difference cannot only be explained by the fact that the C++ version has been parallelized and the Pascal version not).

Jonas

Reply by email

Isaac Gouy
Jonas Maebe wrote 6 lines
I think all Mattias was trying to say is that even if you compare the single core C++ version to the single code Pascal version the C++ version is still 5 times faster than the Pascal version (i.e., the speed difference cannot only be explained by the fact that the C++ version has been parallelized and the Pascal version not).

Thank you for helping to clarify that point - I think my initial comment was that not having Pascal programs written for multi core "has increased the performance difference".

k-nucleotide 5x -> 17x
spectral-norm 2x -> 7x
binary-trees 2x -> 7x

Reply by email

Isaac Gouy
to Mattias Gaertner: On Mon, 9 May 2011 15:04:38 -0700 (PDT) Yes, sorry, if I confused you. I just wanted to…

--- On Mon, 5/9/11, Mattias Gaertner wrote:
-snip-

I wonder why the Perl median dropped from 46 to 137.

It kind-of depends where you got those numbers from :-)

1) Notice that in the blog post ( http://wp.me/puJY-7N ) the blogger has chosen to apply his own weighting to the first table of measurements before combining them into a Geometric Mean.

For example, the blogger chose to exclude the regex-dna task but to include the meteor-contest thread-ring and chameneos-redux tasks.

Did you get 46 from the first table in the blog post? (weighted Geometric Mean including memory use)

2) The default weighting excludes thread-ring and chameneos-redux (now there are threaded programs for the other tasks, those tasks seem very artificial); and excludes meteor-contest because it's a contest.

The default weighting is used for the second table of inter-quartile and median summary statistics.

Did you get 137 from the second table in the blog post? (Median)

Reply by email

Mattias Gaertner
to Isaac Gouy
Show quoted text 15 lines
--- On Mon, 5/9/11, Mattias Gaertner wrote: -snip- > I wonder why the Perl median dropped from 46 to 137. It kind-of depends where you got those numbers from :-) 1) Notice that in the blog post ( http://wp.me/puJY-7N ) the blogger has chosen to apply his own weighting to the first table of measurements before combining them into a Geometric Mean. For example, the blogger chose to exclude the regex-dna task but to include the meteor-contest thread-ring and chameneos-redux tasks. Did you get 46 from the first table in the blog post? (weighted Geometric Mean including memory use)

yes

Show quoted text 5 lines
2) The default weighting excludes thread-ring and chameneos-redux (now there are threaded programs for the other tasks, those tasks seem very artificial); and excludes meteor-contest because it's a contest. The default weighting is used for the second table of inter-quartile and median summary statistics. Did you get 137 from the second table in the blog post? (Median)

yes

Thanks.

Mattias

Reply by email