F# performance benchmarks
  Home FAQ Contact Sign in
comp.lang.functional only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.functional Profile…
 Up
F# performance benchmarks         


Author: Jon Harrop
Date: Aug 29, 2007 14:43

Having been using F# for many months now and typically seeing a slowdown
when porting OCaml code to F#, I was pleasantly surprised to find that F#
is already much faster than OCaml on some interesting benchmarks.

Specifically, the numerically-intensive spectral-norm and n-body benchmarks
from the shootout. I get:

ocamlopt g++ -O3 F#
Spectral-norm 14.94s 9.34s 9.37s
N-body 9.23s 8.21s 6.87s

I find this particularly interesting because these are bast-case results for
OCaml and C++. Specifically, the machine is a 2x Athlon 64 (OCaml does
worse on Intels) and the F# is running in 32-bit Win XP but OCaml and g++
are in 64-bit Linux.

Any have data running F# on 64-bit Windows?

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet
95 Comments
Re: F# performance benchmarks         


Author: Markus E L
Date: Aug 29, 2007 15:35

Jon Harrop wrote:
> I find this particularly interesting because these are bast-case results for
> OCaml and C++. Specifically, the machine is a 2x Athlon 64 (OCaml does
> worse on Intels) and the F# is running in 32-bit Win XP but OCaml and g++
> are in 64-bit Linux.

Hm. I've heard about slowdowns on 64bit because there is more data to
be shoveld over the bus (and the effective cache size in ints/pointers
is only half). So I would be cautious to call that best case results:
Try comparing 32bit and 32Bit or 64 and 64 and then we can talk.

Regards -- Markus
no comments
Re: F# performance benchmarks         


Author: Isaac Gouy
Date: Aug 30, 2007 10:34

On Aug 29, 2:43 pm, Jon Harrop ffconsultancy.com> wrote:
> Having been using F# for many months now and typically seeing a slowdown
> when porting OCaml code to F#, I was pleasantly surprised to find that F#
> is already much faster than OCaml on some interesting benchmarks.
>
> Specifically, the numerically-intensive spectral-norm and n-body benchmarks
> from the shootout. I get:
>
> ocamlopt g++ -O3 F#
> Spectral-norm 14.94s 9.34s 9.37s
> N-body 9.23s 8.21s 6.87s
>
> I find this particularly interesting because these are bast-case results for
> OCaml and C++. Specifically, the machine is a 2x Athlon 64 (OCaml does
> worse on Intels) and the F# is running in 32-bit Win XP but OCaml and g++
> are in 64-bit Linux.

I think you're blazing new ground!

I don't remember seeing side-by-side programming language timings
where the measurements were made on different OSs.
Show full article (1.04Kb)
no comments
Re: F# performance benchmarks         


Date: Aug 30, 2007 14:49

On Aug 29, 5:43 pm, Jon Harrop ffconsultancy.com> wrote:
> Having been using F# for many months now and typically seeing a slowdown
> when porting OCaml code to F#, I was pleasantly surprised to find that F#
> is already much faster than OCaml on some interesting benchmarks.
>
> Specifically, the numerically-intensive spectral-norm and n-body benchmarks
> from the shootout. I get:
>
> ocamlopt g++ -O3 F#
> Spectral-norm 14.94s 9.34s 9.37s
> N-body 9.23s 8.21s 6.87s
>
> I find this particularly interesting because these are bast-case results for
> OCaml and C++. Specifically, the machine is a 2x Athlon 64 (OCaml does
> worse on Intels) and the F# is running in 32-bit Win XP but OCaml and g++
> are in 64-bit Linux.
>
> Any have data running F# on 64-bit Windows?
>
> -- ...
Show full article (1.33Kb)
no comments
Re: F# performance benchmarks         


Author: Jon Harrop
Date: Aug 31, 2007 12:20

Isaac Gouy wrote:
> I think you're blazing new ground!
>
> I don't remember seeing side-by-side programming language timings
> where the measurements were made on different OSs.
>
> Should we look forward to side-by-side comparions where OCaml was
> measured on Athlon and F# was measured on Xeon? ;-)

I'll be sure to learn how to benchmark properly from you, Isaac:

http://shootout.alioth.debian.org/sandbox/benchmark.php?test=binarytrees&lang=ocaml&id...
- "De-optimized by Isaac Gouy"

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet
no comments
Re: F# performance benchmarks         


Author: Jon Harrop
Date: Aug 31, 2007 12:31

baguasquirrel@gmail.com wrote:
> I think that's awesome, but how useful is performance these days? I
> don't think people use python because it's fast. *I* certainly don't
> use ocaml because it *is* fast. I use it because it's damn faster to
> write code in than anything else. Testing and debugging python code
> totally sucks. I rarely test/debug ocaml code. When I do, it's
> fairly simple and straightforward.

Well, performance is still vital for a wide variety of important
applications in science and engineering. So the performance of languages in
their respective environments is significant for anyone wanting to do such
work.

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet
no comments
Re: F# performance benchmarks         


Author: Markus E L
Date: Aug 31, 2007 18:15

Jon Harrop wrote:
> Isaac Gouy wrote:
>> I think you're blazing new ground!
>>
>> I don't remember seeing side-by-side programming language timings
>> where the measurements were made on different OSs.
>>
>> Should we look forward to side-by-side comparions where OCaml was
>> measured on Athlon and F# was measured on Xeon? ;-)
>
> I'll be sure to learn how to benchmark properly from you, Isaac:
>
> http://shootout.alioth.debian.org/sandbox/benchmark.php?test=binarytrees&lang=ocaml&id...
> - "De-optimized by Isaac Gouy"
Show full article (1.03Kb)
no comments
Re: F# performance benchmarks         


Author: Markus E L
Date: Aug 31, 2007 18:10

Jon Harrop wrote:
> baguasquirrel@gmail.com wrote:
>> I think that's awesome, but how useful is performance these days? I
>> don't think people use python because it's fast. *I* certainly don't
>> use ocaml because it *is* fast. I use it because it's damn faster to
>> write code in than anything else. Testing and debugging python code
>> totally sucks. I rarely test/debug ocaml code. When I do, it's
>> fairly simple and straightforward.
>
> Well, performance is still vital for a wide variety of important
> applications in science and engineering. So the performance of languages in
> their respective environments is significant for anyone wanting to do such
> work.

It is not unimportant but not important beyond everything else. I
think it has been suggested before that you're exhibiting a rather
unhealthy fixation on performance (on performance almost alone) and...
Show full article (2.20Kb)
no comments
Re: F# performance benchmarks         


Author: Jon Harrop
Date: Sep 1, 2007 03:12

Markus E L wrote:
> Oh, come on. This is becoming stale. Not that I could say that of if
> I.G. can benchmark or does benchmark right. We know that is a pet
> peeve of yours, but instead of focusing on what Isaac does wrong, do
> it better. It shouldn't be difficult to build a better benchmarking
> side _if_ you do it right, that means (a) don't compare apples with
> oranges, (b) keep the proper scientific spirit regarding the openness
> of results and (c) state clearly what the purpose of the benchmarks
> is.

I already did.

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet
no comments
Re: F# performance benchmarks         


Author: Szabolcs
Date: Sep 1, 2007 08:54

Jon Harrop wrote:
> Specifically, the numerically-intensive spectral-norm and n-body benchmarks
> from the shootout. I get:
>
> ocamlopt g++ -O3 F#
> Spectral-norm 14.94s 9.34s 9.37s
> N-body 9.23s 8.21s 6.87s

What version of gcc did you use? I find it very hard to believe that F#
produces faster code than g++ ... But gcc 3.4.5 (mingw) has trouble
optimising the C++ (not C) version of the n-body program. On my
machine, the newer mingw 4.2.1 (dw2) compiler produces code that is more
than twice faster (~70 s for 3.4.5 vs. ~25 s for 4.2.1).

And as other people said, it would be nice if you did the benchmarks
again, running the programs on the same operating system. I am curious
about the results.
no comments
1 2 3 4 5 6 7 8 9