From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA18526; Wed, 10 Jul 2002 22:51:31 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA18521 for ; Wed, 10 Jul 2002 22:51:30 +0200 (MET DST) Received: from str12.sobor.org (adsl-63-198-183-99.dsl.snfc21.pacbell.net [63.198.183.99]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6AKpTn10684 for ; Wed, 10 Jul 2002 22:51:29 +0200 (MET DST) Received: from localhost (localhost.localdomain [127.0.0.1]) by str12.sobor.org (Postfix) with ESMTP id 274C599860; Wed, 10 Jul 2002 13:47:33 -0700 (PDT) Date: Wed, 10 Jul 2002 13:47:32 -0700 (PDT) Message-Id: <20020710.134732.63116839.avv@quasar.ipa.nw.ru> To: wneumann@cs.unm.edu Cc: oleg_inconnu@myrealbox.com, sebastien.furic@tni-valiosys.com, jjinux@yahoo.com, caml-list@inria.fr Subject: Re: [Caml-list] Re: Sieve of Eratosthenes Performance: various languages From: "Alexander V.Voinov" In-Reply-To: References: <200207102014.QAA14544@dewberry.cc.columbia.edu> X-Mailer: Mew version 2.2 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi William, But it is completely imperative. As I understand, the original Oleg's concern was that he doesn't see a point in learning something which doesn't bring any benefit over C++. Personally, I don't see a point in using OCaml _solely_ as a Pascal with GC. The only reason which justifies for me your quoted exercise is that when you deadly need an efficient imperative part in your program you can (quite likely) achieve this without leaving the language (to a C extension or whatever). Alexander From: "William D. Neumann" Subject: [Caml-list] Re: Sieve of Eratosthenes Performance: various languages (Re: [Caml-list] productivity improvement) Date: Wed, 10 Jul 2002 14:34:52 -0600 (MDT) > Gah!!! You guys are making me nuts! > > Not because of this topic (I actually find this somewhat interesting -- > even if I don't know why), but because every post on the subject has > ignored the two most basic optimizations that should be done for this > small prime generation: > Doing trial division only up to the square root of the candidate (and) > Incrementing your candidates by 2 rather than 1 (2 is the only even > prime -- don't waste your time on even numbers!) > > Seriously, why pull out vector libraries, etc. while leaving these pigs in > your pantry? > > For what it's worth, here is my naive 10 minute solution that takes about > 0.2 seconds to generate the first 5000 primes on my 500MHz G4 (and no > fair laughing at my poor programming chops!): ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners