caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: j h woodyatt <jhw@conjury.org>
To: The Caml Trade <caml-list@inria.fr>
Subject: Re: [Caml-list] map implementation question
Date: Thu, 17 Aug 2006 09:25:52 -0700	[thread overview]
Message-ID: <ABB9CEFB-A3B8-498A-86E2-7C398D7B19CE@conjury.org> (raw)
In-Reply-To: <44E454F5.2040406@inria.fr>

On Aug 17, 2006, at 4:37 AM, Xavier Leroy wrote:
>
> This said, red-black trees would probably work faster anyway, but I'll
> let the algorithm experts on this list comment.

My experience trying to tweak the red-black trees in the Cf library  
of OCaml NAE so they perform globally better than the height-balanced  
trees in the standard library has been mixed.  Some functions perform  
marginally better, but others are worse-- sometimes substantially  
worse, and I don't think there's any way around it.  (It doesn't help  
that a lot of my exercises reveal that my binary set operations need  
improvement, but there are other places where there's simply nothing  
to do.  I'll get around to fixing the binary set operators someday,  
before my next release.)

By the way, Xavier is very correct: that "imbalance <= 2" thing is  
utterly brilliant.  I'm pretty sure my red-black trees would smoke  
the standard library if it weren't for that.

The result is that I recommend using my red-black trees only when you  
are either 1) using the other facilities in the Cf library that are  
integrated well with them, e.g. Cf_seq and such, or 2) using them in  
a [currently hypothetical] case where you have compared the  
performance with the standard library and it makes a valuable  
difference to get 15% more CPU (or one less field per tree node) out  
of your tree algorithm.


—
j h woodyatt <jhw@conjury.org>
san francisco, ca



  reply	other threads:[~2006-08-17 18:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04 20:08 Brian Hurt
2006-08-17 11:37 ` [Caml-list] " Xavier Leroy
2006-08-17 16:25   ` j h woodyatt [this message]
2006-08-17 18:54   ` Shawn

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=ABB9CEFB-A3B8-498A-86E2-7C398D7B19CE@conjury.org \
    --to=jhw@conjury.org \
    --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).