caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Jim Grundy <jim.d.grundy@intel.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Functor Performace Question
Date: Sun, 22 Apr 2007 12:04:20 +0200	[thread overview]
Message-ID: <462B3324.2050206@inria.fr> (raw)
In-Reply-To: <461C0C71.7060709@intel.com>

> I have a functor related performance issue.
> I have the following collection of modules and types that we are using
> in the implementation of a SAT solver:
> If we implement Nat_priority_queue in the "right" way as
> module Nat_priority_queue = Make_priority_queue (Nat_map)
> Then I pay about a 3% performance penalty over instantiating the functor
> by hand...
> Is there some compiler switch or future version in the works that will
> save me from this?

Basically, no.  There is indeed a small performance penalty associated
with functors, owing to the fact that the functor body is compiled
only once without knowledge of its arguments.  Late specialization of
functors would be nice in the absolute, but would require a major
rework of the OCaml compiler.  This said, a 3% speed penalty is not
too bad --- to me, it's lost in the noise of performance measurement.

Regards,

- Xavier Leroy


      parent reply	other threads:[~2007-04-22 10:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10 22:15 Jim Grundy
2007-04-10 22:37 ` [Caml-list] " Till Varoquaux
2007-04-22 10:04 ` Xavier Leroy [this message]

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=462B3324.2050206@inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=jim.d.grundy@intel.com \
    /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).