caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Optimizing symbolic processing code
Date: Fri, 16 Jan 2009 13:41:53 +0000	[thread overview]
Message-ID: <200901161341.53632.jon@ffconsultancy.com> (raw)
In-Reply-To: <4970488C.9080104@inescporto.pt>

On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote:
> Hello,
>
> I have implemented a simple Prolog like inference engine
> to be used in machine learning algorithms (ILP). My first
> basic test shows that inference is dismally slow (compared
> to a Prolog compiler).

Can you quantify that?

> Consequently I am looking for information on optimizing the code.

IIRC, the single most productive optimization I made to the Mathematica 
implementation I wrote in OCaml was to check when recursive rewrites were 
leaving an expression unaltered and return the original when possible to 
avoid copying. I don't know if that is relevant here.

Also IIRC, someone else wrote that they lashed together a quick Prolog 
implementation in OCaml and were surprised to find it outperforming real 
Prolog compilers.

> I have found: 
>
> http://ocaml.janestreet.com/?q=node/30
> http://camltastic.blogspot.com/2008/05/optimizing-memory-allocation-and-loo
>ps.html
>
> Does anyone have any other links or articles I may look at?

The articles on low-level optimization in the OCaml Journal are almost 
certainly relevant. OCaml for Scientists covers data structure performance in 
detail. No other sources are as comprehensive with regard to optimization 
AFAIK.

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e


  parent reply	other threads:[~2009-01-16 13:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16  8:42 Hugo Ferreira
2009-01-16  9:05 ` [Caml-list] " blue storm
2009-01-16  9:44   ` Hugo Ferreira
2009-01-16 13:41 ` Jon Harrop [this message]
2009-01-16 14:15   ` Hugo Ferreira
2009-01-16 16:14     ` Peter Ilberg
2009-01-16 16:19       ` Hugo Ferreira
2009-01-16 19:09         ` Andrej Bauer
2009-01-16 20:48           ` Andrej Bauer
2009-01-17  9:28             ` Hugo Ferreira
2009-01-17 11:39               ` Andrej Bauer
2009-01-17 15:47                 ` Hugo Ferreira
2009-01-17 16:08                   ` Hugo Ferreira
2009-01-16 21:46         ` Kuba Ober
2009-01-17  9:46           ` Hugo Ferreira

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=200901161341.53632.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;
as well as URLs for NNTP newsgroup(s).