caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jonathandeanharrop@googlemail.com>
To: <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] about OcamIL
Date: Thu, 20 May 2010 03:03:09 +0100	[thread overview]
Message-ID: <009b01caf7c0$99968340$ccc389c0$@com> (raw)
In-Reply-To: <20100519094634.63006zi1h04x95z4@imp.ovh.net>

Xavier Clerc wrote:
> Jon Harrop <jonathandeanharrop@googlemail.com> a écrit :
> > I don't think this is heated at all. We were talking about "high
> > performance" languages and you cited a bunch of languages that get
> whipped
> > by Python on this benchmark:
> >
> >
> > http://flyingfrogblog.blogspot.com/2009/04/f-vs-ocaml-vs-haskell-
> hash-table.
> > html
> 
> Acknowledged.
> "Whipped" is here 2 times slower on that particular benchmark,
> while Python is rarely within an order of magnitude of OCaml code
> (cf. the language shootout).
> Moreover, hashtables are ubiquitous in Python (and hence probably
> particularly optimized), while they are not so common in Haskell
> or Caml.

I greatly value efficient generic collections.

> >> and references to benchmarks that back up your claims in this
> thread.
> >
> >   http://fsharpnews.blogspot.com/2010/05/java-vs-f.html
> 
> Point taken.
> Just notice that the 17x factor is observed on the micro-benchmark,
> while on the larger one the two platforms seem on par.

Sure but those two benchmarks are testing completely different things.  The
shootout's knucleotide is a larger benchmark that still uses hash tables and
Java is still 4x slower because the JVM cannot express a generic hash table
efficiently. There are many such problems where the lack of value types on
the JVM is a serious impediment to performance.

> Here is a question about the micro-benchmark: do you know if F# do
> monomorphize the collection in this example?
> If it turns out to be done, one may probably argue that the problem
> is more related to the language than to the platform (just recycling
> an objection made on the page you pointed out).

I'm not sure what you mean here. Both of the programs are just using the
generic hash table implementation native to their platform. Neither language
does anything of relevance to optimize the code. .NET is a lot faster and
uses a lot less memory than the JVM because it stores keys and values
unboxed in the spine of the hash table because they are value types whereas
the JVM boxes them, and because the insertion function is monomorphized at
JIT time.

> > Scala on the JVM is 7x slower than C++ on this benchmark:
> >
> http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=scal
> a&lan
> > g2=gpp
> 
> Agreed, but it seems that if you aggregate the results of the different
> benchmarks, Scala is on average only 1.5x from C++ (but far away in
> terms
> of memory consumption). The 7x factor is observed the worst result,
> the median being 2x.

Sure. This seems to be a difference in our interpretation of "high
performance". If a language or platform can be 17x slower than others then I
would not call it "high performance" even if it is competitively performant
elsewhere. Indeed, I would completely disregard averages on benchmark suites
and focus on outliers because they convey more useful information. Granted
that was a microbenchmark but the effect is severe enough to afflict many
real programs.

> >> It may just end up that we have different perceptions of "high
> >> performance", and of the trade-offs we are going to make in our
> >> language / platform choices.
> >
> > Probably. What languages do not you not consider to be high
> > performance?
> 
> I am not sure it is that easy to compare languages, but measuring
> compiler
> performances: any compiler that produces code that runs within -let's
> say- 5x
> of the fastest one around, on a bunch of wide-spectrum benchmarks (e.
> g.
> numerical code *plus* string matching *plus* tree walking, etc).
> Maybe it should also be mentioned that I am more versed into symbolic
> computations.

Then you're probably more interested in OCaml's GC vs parallelism when
performance is important.

> Regarding trade-offs, I am also inclined to favor Open Source solutions
> and
> higher-level languages (the trade-off being here execution time vs
> programming/debugging time).

I agree in general, of course, but I'm not sure "higher-level languages"
means much in this context. Is C# higher level than Java? Maybe, but I'm
interested in the value types and approach to generics here.

Monomorphization and unboxed tuples get you a long way towards decent
performance without a top-notch GC tuned for functional languages. That
makes it feasible to implement with a naïve multicore-capable GC, which is
precisely the current direction of HLVM.

> PS: as an aside, I used the word "references" for academic publications
> that went through a reviewing process, not blog entries.

I see. I value reproducible results far higher than peer reviewed academic
papers, particularly in this context.

Cheers,
Jon.



  parent reply	other threads:[~2010-05-20  2:03 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 12:06 ben kuin
2010-05-05 14:19 ` [Caml-list] " Alain Frisch
     [not found]   ` <i2sc0c8bc8b1005051446q34b07d37xc4021d2b4b23d4e2@mail.gmail.com>
     [not found]     ` <4BE28085.5090100@lexifi.com>
2010-05-06 10:59       ` ben kuin
2010-05-05 18:58 ` Eray Ozkural
2010-05-05 19:16   ` Ed Keith
2010-05-05 20:15     ` Eray Ozkural
2010-05-05 22:13     ` Vincent Aravantinos
2010-05-05 22:36       ` ben kuin
2010-05-05 23:13         ` Eray Ozkural
2010-05-06 10:45           ` ben kuin
2010-05-06 14:38         ` Tim Hanson
2010-05-05 22:18     ` ben kuin
2010-05-06 11:13       ` Ed Keith
2010-05-06 10:43     ` Dmitry Bely
2010-05-06 16:33       ` Peng Zang
2010-05-07  7:26         ` Dmitry Bely
2010-05-07  8:25           ` Sylvain Le Gall
2010-05-10 21:53         ` [Caml-list] " Jon Harrop
2010-05-11 11:22           ` ben kuin
2010-05-11 16:39             ` Peng Zang
2010-05-11 17:35               ` Raoul Duke
2010-05-11 23:47               ` ben kuin
2010-05-12  1:57                 ` Peng Zang
2010-05-12 11:56               ` Jon Harrop
2010-05-11 17:38             ` Raoul Duke
2010-05-12 12:28             ` Jon Harrop
2010-05-12 13:11               ` forum
2010-05-14 10:40                 ` Jon Harrop
2010-05-14 10:58                   ` Eray Ozkural
2010-05-14 11:51                     ` forum
2010-05-14 11:51                   ` forum
2010-05-16 20:31                     ` Jon Harrop
2010-05-17  7:53                       ` forum
2010-05-19  0:17                         ` Jon Harrop
2010-05-19  7:46                           ` forum
2010-05-19 11:29                             ` Michael Ekstrand
2010-05-19 13:27                               ` [Caml-list] " Eray Ozkural
2010-05-19 13:35                                 ` David Allsopp
2010-05-19 15:23                                   ` Erick Tryzelaar
2010-05-19 16:49                                   ` Goswin von Brederlow
2010-05-19 16:48                                 ` Goswin von Brederlow
2010-05-20  2:03                             ` Jon Harrop [this message]
2010-05-14 13:55                   ` [Caml-list] " Ed Keith
2010-05-14 15:17                   ` Goswin von Brederlow
2010-05-14 16:26                     ` ben kuin
2010-05-14 16:32                       ` Vincent Aravantinos
2010-05-14 20:08                         ` ben kuin
2010-05-14 21:28                           ` Sylvain Le Gall
2010-05-14 21:29                             ` [Caml-list] " Vincent Aravantinos
2010-05-14 23:51                             ` ben kuin
2010-05-15  0:48                           ` [Caml-list] " Jon Harrop
2010-05-14 18:11                       ` Raoul Duke
2010-05-14 18:59                         ` ben kuin
     [not found]                           ` <AANLkTik-EuZRmX8VKMdAIsO_t8JGHvS6F9TPVLkohed8@mail.gmail.com>
2010-05-14 21:42                             ` Fwd: " Raoul Duke
2010-05-14 21:47                               ` Vincent Aravantinos
2010-05-14 21:57                                 ` Raoul Duke
2010-05-15  0:16                                 ` ben kuin
2010-05-15  0:43                                   ` Erik de Castro Lopo
2010-05-15  2:16                                     ` Goswin von Brederlow
2010-05-15 21:27                                       ` Jon Harrop
2010-05-16  3:19                                         ` Goswin von Brederlow
2010-05-15  9:45                                     ` ben kuin
2010-05-15 12:07                                       ` Ed Keith
2010-05-15 12:17                                       ` Vincent Aravantinos
2010-05-15 13:21                                         ` ben kuin
2010-05-15 22:18                                           ` Erik de Castro Lopo
2010-05-15 23:39                                             ` ben kuin
2010-05-16  3:23                                             ` Goswin von Brederlow
2010-05-15 13:23                                       ` Goswin von Brederlow
2010-05-15 21:45                                       ` Erik de Castro Lopo
2010-05-15 21:44                               ` Jon Harrop
2010-05-15 22:25                                 ` Erik de Castro Lopo
2010-05-16  2:04                                   ` Jon Harrop
2010-05-16  3:20                                     ` Goswin von Brederlow
2010-05-16 17:50                                     ` Eray Ozkural
2010-05-16 19:15                                       ` ben kuin
2010-05-05 21:59   ` ben kuin

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='009b01caf7c0$99968340$ccc389c0$@com' \
    --to=jonathandeanharrop@googlemail.com \
    --cc=caml-list@yquem.inria.fr \
    /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).