caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Manfred Lotz <manfred.lotz@yahoo.de>
To: caml-list@inria.fr
Subject: Re: Question on writing efficient Ocaml.
Date: Thu, 28 Dec 2006 20:24:40 +0100	[thread overview]
Message-ID: <20061228202440.aefec714.manfred.lotz@yahoo.de> (raw)
In-Reply-To: <BAY114-F190B1A8C554A52013E63ECA9C70@phx.gbl>

On Thu, 28 Dec 2006 11:42:04 +0000
"Ian Oversby" <oversby@hotmail.com> wrote:

> Hi,
> 
> Apologies if this is the wrong forum in which to ask this question.
> Is there anywhere else more
> suitable?
> 
> I've written some Ocaml code to solve the problem of placing 8 queens
> on a board so that none of them attack each-other.  I've also written
> a C++ equivalent which is running much more quickly than the Ocaml.
> I assume I've made some basic errors with the Ocaml - does anyone
> have any suggestions as to what?
> 
> The code is available here:
> 
> http://curiousprogrammer.wordpress.com/2006/12/22/speed-comparison-plt-scheme-ocaml-and-c/
> 
> I compiled the Ocaml with the following command:
> 
> ocamlopt -noassert -unsafe -ccopt -O3 -ccopt -fomit-frame-pointer
> q.ml -o q.exe
> 

I personally don't believe that it is a good idea to use options
like: -noassert -unsafe -ccopt -O3 -ccopt -fomit-frame-pointer
I regard bounds checkings and assertions as good features of Ocaml and
not as something to avoid in order to achieve good performances. 


It is more important to have a stable binary. If you want to speed up
it is a matter of using a good algorithm.


-- 
Manfred


  parent reply	other threads:[~2006-12-28 19:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061203110003.6804FBC6A@yquem.inria.fr>
2006-12-28 11:42 ` Ian Oversby
2006-12-28 16:26   ` [Caml-list] " Jon Harrop
2006-12-28 17:13     ` skaller
2006-12-29  6:05       ` Jacques Garrigue
2006-12-29 11:15         ` Mattias Engdegård
2007-01-06  0:52           ` Nathaniel Gray
2007-01-06  1:01             ` Philippe Wang
2007-01-06  1:15             ` brogoff
2007-01-06  2:27               ` Martin Jambon
2007-01-08 22:23                 ` Nathaniel Gray
2006-12-28 19:24   ` Manfred Lotz [this message]
2006-12-29  1:23   ` Andrej Bauer
2006-12-29  9:58     ` Ian Oversby
2006-12-29  2:07   ` Jon Harrop
2007-01-03 16:43     ` Serge Aleynikov

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=20061228202440.aefec714.manfred.lotz@yahoo.de \
    --to=manfred.lotz@yahoo.de \
    --cc=caml-list@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).