From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] thousands of CPU cores
Date: Fri, 11 Jul 2008 16:08:03 +0100 [thread overview]
Message-ID: <200807111608.03694.jon@ffconsultancy.com> (raw)
In-Reply-To: <48776844.3050708@starynkevitch.net>
On Friday 11 July 2008 15:03:48 Basile STARYNKEVITCH wrote:
> It is not specific to Linux (and probably not even to *opensource*
> functional programming languages; I believe proprietary functional
> languages implementations face the same problems).
Indeed, Mathematica has the same problem but, I believe, Wolfram Research are
migrating it to the JVM for this reason.
> In my perception,
> functional programming requires *blindly fast* memory allocation for
> values which are becoming garbage quickly. This seems a property of
> functional programming (and more generally any programming style
> discouraging side effects), in other words functional programming need
> very efficient garbage collectors (A.Appel wrote stuff on this almost
> 20? years ago).
Although that is established functional folklore, I believe it is misguided to
try to apply that to more mainstream concerns. Moreover, the problem can be
largely avoided by adopting a more modern JIT-based approach to language
implementation anyway.
OCaml and its ancestors and relatives like Haskell have traditionally been
used by academics for applications with the value lifetime distribution that
you describe (very high allocation rates for short lived values) when it is
not unusual to see 30% CPU time spent in the GC.
However, OCaml really pioneered the use of this family of languages in
completely different applications such as numerical methods for scientific
computing thanks to OCaml's unusually good floating point performance. Such
applications do not share the characteristic that you describe but they still
benefit enormously from first-class functions, tail calls, an expressive
static type system and so on. These applications benefit far more from good
code generation than from a fast GC and it is now unusual to see >5% CPU time
spent in the GC for most OCaml programs.
Type specialization during JIT compilation removes the need for a uniform
run-time representation of values which, amongst other things, obviates all
boxing of floats. Value types allow custom data structures to be stored
unboxed when appropriate (e.g. complex numbers).
This is why F# can be so productive for high-performance numerics even though
it is built upon a run-time that was specifically designed for C#'s
characteristics.
> As a case in point, I suggest an experiment (which unfortunately I don't
> have the time or motivation to realize). Replace the current Ocaml GC
> either in bytecode or in nativecode ocaml by Boehm's collector (which is
> multithread compatible). I'm sure you'll get a significant performance
> loss, but you should gain the true multi-threading feature. Of course,
> synchronization issues will appear, very probably in application code
> (and some C function wrappers).
That is an interesting idea and, in fact, perhaps LLVM+Boehm would be the
easiest way to create a new functional language implementation that captures
F#'s productivity.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
next prev parent reply other threads:[~2008-07-11 15:09 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 5:57 J C
2008-07-10 6:15 ` [Caml-list] " Erik de Castro Lopo
2008-07-10 12:47 ` Oliver Bandel
2008-07-10 13:48 ` Hezekiah M. Carty
2008-07-10 11:35 ` Jon Harrop
2008-07-14 11:32 ` J C
2008-07-14 12:08 ` Jon Harrop
2008-07-14 17:04 ` Mike Lin
2008-07-14 17:28 ` Jon Harrop
2008-07-14 17:16 ` Richard Jones
2008-07-10 13:21 ` Jon Harrop
2008-07-10 13:44 ` Peng Zang
2008-07-10 14:00 ` Jon Harrop
2008-07-10 22:25 ` Richard Jones
2008-07-10 23:04 ` Jon Harrop
2008-07-10 23:41 ` Oliver Bandel
2008-07-11 0:17 ` Oliver Bandel
2008-07-11 9:30 ` Richard Jones
2008-09-21 19:05 ` Michaël Grünewald
2008-09-21 21:41 ` Jon Harrop
2008-09-22 7:51 ` Alan Schmitt
2008-09-22 19:03 ` Jon Harrop
2008-09-22 19:49 ` David Teller
2008-09-23 6:42 ` kirillkh
2008-09-24 13:30 ` [Caml-list] Link tracking Chris Clearwater
2008-09-24 15:43 ` Jon Harrop
2008-07-11 14:53 ` [Caml-list] thousands of CPU cores Peng Zang
2008-07-15 14:39 ` Kuba Ober
2008-07-19 12:41 ` Oliver Bandel
2008-07-10 19:15 ` Gerd Stolpmann
2008-07-10 20:07 ` Sylvain Le Gall
2008-07-10 20:24 ` [Caml-list] " Gerd Stolpmann
2008-07-10 21:02 ` Sylvain Le Gall
2008-07-10 21:19 ` [Caml-list] " Gerd Stolpmann
2008-07-10 21:35 ` Jon Harrop
2008-07-10 22:39 ` Gerd Stolpmann
2008-07-15 15:57 ` Kuba Ober
2008-07-15 18:03 ` Gerd Stolpmann
2008-07-15 19:23 ` Adrien
2008-07-15 19:45 ` Adrien
2008-07-16 8:59 ` Michaël Grünewald
2008-07-16 16:43 ` Gerd Stolpmann
2008-07-16 11:46 ` Richard Jones
2008-07-16 18:35 ` Erik de Castro Lopo
2008-07-17 12:48 ` Kuba Ober
2008-07-15 15:21 ` Kuba Ober
2008-07-10 20:48 ` Basile STARYNKEVITCH
2008-07-10 21:12 ` Jon Harrop
2008-07-10 23:33 ` [Caml-list] " Oliver Bandel
2008-07-10 23:43 ` Oliver Bandel
2008-07-11 6:26 ` Sylvain Le Gall
2008-07-11 8:50 ` [Caml-list] " Jon Harrop
2008-07-11 9:29 ` Sylvain Le Gall
2008-07-15 16:01 ` [Caml-list] " Kuba Ober
2008-07-13 3:17 ` Code Mobility [was Re: thousands of CPU cores] Robert Fischer
2008-07-11 3:01 ` [Caml-list] thousands of CPU cores Brian Hurt
2008-07-11 13:01 ` Gerd Stolpmann
2008-07-11 13:43 ` Jon Harrop
2008-07-11 14:03 ` Basile STARYNKEVITCH
2008-07-11 15:08 ` Jon Harrop [this message]
2008-07-11 17:28 ` Jon Harrop
2008-07-11 17:54 ` Richard Jones
2008-07-11 18:30 ` Raoul Duke
2008-07-12 17:35 ` Brian Hurt
2008-07-11 15:01 ` Peng Zang
2008-07-12 0:23 ` Oliver Bandel
2008-07-12 22:54 ` J C
2008-07-19 12:06 ` Oliver Bandel
2008-07-11 14:06 ` Xavier Leroy
2008-07-11 15:20 ` Oliver Bandel
2008-07-11 15:23 ` Bill
2008-07-11 18:14 ` Mattias Engdegård
2008-07-12 23:05 ` J C
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=200807111608.03694.jon@ffconsultancy.com \
--to=jon@ffconsultancy.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