Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] productivity improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-07-10 (20:51)
From: Alexander V.Voinov <avv@q...>
Subject: Re: [Caml-list] Re: Sieve of Eratosthenes Performance: various languages
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).


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 Archives:
Bug reports: FAQ:
Beginner's list: