caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alexandre Pilkiewicz <Alexandre.Pilkiewicz@polytechnique.org>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions of Set and Map
Date: Sat, 26 Apr 2008 16:44:43 +0200	[thread overview]
Message-ID: <200804261644.43358.Alexandre.Pilkiewicz@polytechnique.org> (raw)
In-Reply-To: <008b01c8a549$e6fa0600$017ca8c0@countertenor>

Le Wednesday 23 April 2008 15:56:47 David Allsopp, vous avez écrit :
> All that said, and especially as StdLib changes are reasonably rare, I find
> having files IntSet.ml and IntSet.mli containing:
>
> include Set.Make(struct type t = int let compare = Pervasives.compare end)
>
> and
>
> include Set.S with type elt = int

One should probably use an other function than Pervasives.compare in that 
case. Some "benchmarks" show that 100 000 000 uses of comp with different 
definitions lead to some important differences for performance

let comp = compare   
-> 1,54s


let comp (i:int) (j:int) = compare i j
-> 0.7s


let comp (i:int) (j:int) = 
  if i = j then 0 else if i < j then -1 else 1
-> 0.18s

-- 
Alexandre Pilkiewicz


  parent reply	other threads:[~2008-04-26 14:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21  9:39 Announce: xsetxmap, unfunctorized, Sexp-lib aware versions " Berke Durak
2008-04-21 10:59 ` [Caml-list] " Jean-Christophe Filliâtre
2008-04-21 11:19   ` Berke Durak
2008-04-23 12:35     ` Jon Harrop
2008-04-23 13:25       ` Brian Hurt
2008-04-23 13:56         ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions " David Allsopp
2008-04-23 14:22           ` Berke Durak
2008-04-26 14:44           ` Alexandre Pilkiewicz [this message]
2008-04-23 13:41       ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions " Berke Durak

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=200804261644.43358.Alexandre.Pilkiewicz@polytechnique.org \
    --to=alexandre.pilkiewicz@polytechnique.org \
    --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).