caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Thomas Fischbacher <tf@functionality.de>
To: skaller <skaller@users.sourceforge.net>
Cc: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>,
	sds@gnu.org, caml-list@inria.fr
Subject: Re: [Caml-list] Re: compiling large file hogs RAM and takes a long time.
Date: Fri, 08 Jun 2007 10:55:44 +0100	[thread overview]
Message-ID: <466927A0.9090309@functionality.de> (raw)
In-Reply-To: <1181295353.20252.26.camel@rosella.wigram>

skaller wrote:

> Perhaps you're right .. still, there's a big difference
> between a 5 minute compile (enough time to make a coffee!)
> and a 2 hour compile (enough time to have lunch!)

The point I wanted to make here is: when it comes to the evaluation
whether extra logarithmic factors in time complexity do matter or
not, it is very important to also pay attention to the constants
involved.

For example, take a set of N magnetic needles distributed randomly
over space. In order to find the magnetic field experienced by every
single needle that is created by all the others, you can do a naive
O(N^2) algorithm that just sums contributions. There is a more
clever - and technically very sophisticated - technique that uses
multipole expansions to get a good approximation (the
"fast multipole method"), which can be computed in O(N log N),
but the constants are such that the break even point is not
reached before N=1000, and depending how well your code is
written, may lie above N=5000.

If such a situation arouse, I would, for example,
not have any objections against trading an O(N log N) algorithm
for an O(N log N log N) algorithm that is conceptually so much
simpler that the constant factor is smaller by two orders
of magnitude...

> I usually illustrate this by asking if you'd be happy
> to give up your 2 / 52 week annual holiday .. that's
> under 4% of the year.. I'm sure you'd be horrified ..
> 4% is a LOT!

I am always amazed when I hear this, thinking that we
Europeans typically get at least 5 weeks of holiday
per year. :-)

Admittedly, according to the CIA world factbook, GDP
per capita is about 1/4 higher in the US than in Germany
(say), but I still prefer the more relaxed European model.

-- 
best regards,
Thomas Fischbacher
tf@functionality.de


  reply	other threads:[~2007-06-08  9:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 16:30 Sam Steingold
2007-06-06 16:51 ` [Caml-list] " skaller
2007-06-06 17:05   ` Sam Steingold
2007-06-07 15:52 ` Sam Steingold
2007-06-08  1:02   ` [Caml-list] " Jacques Garrigue
2007-06-08  1:51     ` skaller
2007-06-08  2:26       ` Yaron Minsky
2007-06-08  9:05       ` Thomas Fischbacher
2007-06-08  9:35         ` skaller
2007-06-08  9:55           ` Thomas Fischbacher [this message]
2007-06-08 13:39       ` Sam Steingold
2007-06-08 12:30     ` [Caml-list] " Jacques Garrigue
2007-06-15 15:41       ` Sam Steingold
2007-06-15 18:56         ` [Caml-list] " Jon Harrop
2007-06-15 20:06           ` Sam Steingold
2007-07-09 20:22 ` large parametrized polymorphic variant type combinations take forever to compile Sam Steingold
2007-07-09 22:45   ` Sam Steingold
2007-07-09 23:37   ` [Caml-list] " Jacques Garrigue
2007-07-10  7:09     ` Christophe Raffalli
2007-07-10  7:31       ` Jacques Garrigue
2007-07-10 14:16     ` Sam Steingold
2007-07-10 16:49     ` Sam Steingold
     [not found]     ` <46938BDA.1090605@podval.org>
2007-07-11  0:10       ` [Caml-list] " Jacques Garrigue
2007-07-11  1:19         ` Jon Harrop
2007-07-11  2:23           ` Jacques GARRIGUE
2007-07-11 13:12         ` Sam Steingold
2007-07-11 19:17           ` [Caml-list] " Jon Harrop
2007-07-10  3:34   ` [Caml-list] " skaller
2007-07-10 13:27     ` Sam Steingold

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=466927A0.9090309@functionality.de \
    --to=tf@functionality.de \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=sds@gnu.org \
    --cc=skaller@users.sourceforge.net \
    /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).