caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: jon@ffconsultancy.com
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OC4MC : OCaml for Multicore architectures
Date: Fri, 25 Sep 2009 13:07:21 +0900 (JST)	[thread overview]
Message-ID: <20090925.130721.70227045.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <200909242209.50565.jon@ffconsultancy.com>

First, like everybody else, I'd like very much to try this out.
Is there any chance it could compile on Snow Leopard :-)
(I suppose it's near impossible, but still ask...)

From: Jon Harrop <jon@ffconsultancy.com>
> Visual Basic has been a *lot* faster than OCaml for several years now, not 
> least because it makes efficient multicore programming easy. Even Python is 
> beating OCaml on benchmarks now:
> 
> http://flyingfrogblog.blogspot.com/2009/04/f-vs-ocaml-vs-haskell-hash-table.html

IIRC, currently Visual Basic is just a "skin" for C#. You have to
write all the types, so it's rather hard to call it "Basic". And yes,
MS has invested a lot in the CLR, and that pays.

Your benchmark seems strange to me, as you are comparing apples with
oranges. Hashtables in Python are a basic feature of the language,
and they are of course implemented in C. In ocaml, they are
implemented in ocaml (except the hashing function, which has to be
polymorphic), using an array of association lists!
(Actually the pairs are flattened for better performance, but still)
What is impressive is that you don't need any special optimization to
get reasonably good performance. Actually the only tuning you need is
to start from a reasonable table size, which you didn't (never start
from 1, you will have to redo all the hashing every time the table
needs to be grown).

> Even if that were not the case, the idea of cherry picking interpreted 
> scripting languages to compete with because OCaml has fallen so far behind 
> mainstream languages (let alone modern languages) is embarrassing. What's 
> next, OCaml vs Bash for your high performance needs?

OCaml was never touted as an HPC language! The only claim I've seen is
that it intends to stay within 2x of C for most applications. (Which
is not so easy these days, gcc getting much faster.)

Actually, I believe that Philippe's point is rather different.
Making a functional language work well on multicores is difficult.
If I tell you that you just have to modify a bit your program to get a
near linear speedup, then it looks great. But in practice it is rather
having to rethink completely your algorithm, to eventually get a speedup
bounded by bandwidth, and starting from a point lower than the original
single thread program. There are applications for that (ray tracing is
one), but this is not the kind of needs most people have.

By the way, I was discussing with numerical computation people working
on BLAS the other day, and their answer was clear: if you need high
performance, better use a grid than SMP, since bandwidth is
paramount. And you have to write in C or FORTRAN (or asm), because the
timing of instructions matter. The funniest part was that those people
were working on integer computations, but had to stick to floating
point, because timing on integers is unpredictable, making
synchronization harder.

Cheers,

Jacques


  parent reply	other threads:[~2009-09-25  4:07 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 21:30 Philippe Wang
2009-09-23 10:53 ` [Caml-list] " Goswin von Brederlow
2009-09-23 12:21   ` Jon Harrop
2009-09-23 13:00     ` Jon Harrop
2009-09-23 14:26       ` Philippe Wang
2009-09-24  0:21   ` Jon Harrop
2009-09-23 23:15     ` Philippe Wang
2009-09-24  0:05       ` Jon Harrop
2009-09-24  0:01         ` Philippe Wang
2009-09-24  1:47           ` Jon Harrop
2009-09-24  9:49             ` Richard Jones
2009-09-24 10:00               ` rixed
2009-09-24 10:40               ` Florian Hars
2009-09-24 11:45               ` Jon Harrop
2009-09-24 10:00             ` kcheung
2009-09-24 11:52               ` Jon Harrop
2009-09-24 11:55                 ` Rakotomandimby Mihamina
2009-09-24 12:11                 ` rixed
2009-09-24 15:58                   ` Jon Harrop
2009-09-24 12:39                 ` Stefano Zacchiroli
2009-09-24 13:09                   ` Jon Harrop
2009-09-24 16:49                     ` Richard Jones
2009-09-24 16:56                       ` Philippe Wang
2009-09-24 17:36                         ` Richard Jones
2009-09-24 19:39                         ` rixed
2009-09-24 21:09                       ` Jon Harrop
2009-09-24 21:26                         ` rixed
2009-09-25  4:07                         ` Jacques Garrigue [this message]
2009-09-25  7:32                           ` Hugo Ferreira
2009-09-25 10:17                             ` Jon Harrop
2009-09-25 13:04                               ` kcheung
2009-09-25 21:39                             ` Gerd Stolpmann
2009-09-25  9:33                           ` Philippe Wang
2009-09-25 21:39                           ` Jon Harrop
2009-09-26 16:55                             ` Jon Harrop
2009-09-25  8:08                         ` Stéphane Glondu
2009-09-25 15:05                     ` Xavier Leroy
2009-09-25 23:26                       ` Benjamin Canou
2009-09-26  0:45                         ` kcheung
2009-09-26  1:53                           ` Jon Harrop
2009-09-26 13:51                             ` kcheung
2009-09-26 14:46                               ` Jon Harrop
2009-10-10  4:01                         ` Jon Harrop
2009-09-24 13:40                   ` Rakotomandimby Mihamina
2009-09-24 14:22                     ` Philippe Wang
2009-09-24 14:49                     ` Stefano Zacchiroli
2009-09-24 13:55                   ` Mike Lin
2009-09-24 14:52                     ` Stefano Zacchiroli
2009-09-24 15:36                 ` Philippe Wang
2009-09-24 15:50                   ` Jon Harrop
2009-09-24 12:14             ` Philippe Wang
2009-09-24 13:11               ` Jon Harrop
2009-09-24 14:51                 ` Philippe Wang
2009-09-24 14:57       ` Philippe Wang
2009-09-24 14:11 ` Dario Teixeira
2009-09-24 14:38   ` Philippe Wang
2009-09-24 15:20     ` Dario Teixeira
2009-09-24 23:28     ` Jon Harrop
2009-09-24 23:25       ` Philippe Wang
2009-09-25 14:11       ` Philippe Wang
2009-11-08 18:12       ` Jon Harrop
2009-09-24 18:24 ` David Teller
     [not found] <20090924154716.BCD0ABC5A@yquem.inria.fr>
2009-09-24 16:02 ` Pascal Cuoq
2009-09-24 16:30   ` Philippe Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090925.130721.70227045.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).