All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Subject: Re: btree vs. linear seach in device mapper
Date: Thu, 4 Apr 2013 15:43:21 +0100	[thread overview]
Message-ID: <20130404144320.GA8207@debian> (raw)
In-Reply-To: <Pine.LNX.4.64.1304041021260.23945@file.rdu.redhat.com>

On Thu, Apr 04, 2013 at 10:27:02AM -0400, Mikulas Patocka wrote:
> BTW. when I see that btree code in dm-table.c, I ask - why doesn't it use 
> binary search?
> 
> We only append targets at the end when constructing the device, we never 
> insert or remove them, so we don't need a tree. For these operations 
> binary search would be as good as btree and it is simpler.

I originally expected dm tables to have many, many more entries than
they do these days (I remember benchmarking it with 1 million
entries).  I used a btree to try and be nicer to the cpu cache; the
idea being that each btree node could fit into a cache line.  Plain
binary search would have caused many more cache faults.

Given how dm is used these days I wouldn't mind a switch to a binary
search.

- Joe

  reply	other threads:[~2013-04-04 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <515599DE.3050104@redhat.com>
     [not found] ` <20130404085848.GC24402@stefanha-thinkpad.redhat.com>
     [not found]   ` <Pine.LNX.4.64.1304040916470.17024@file.rdu.redhat.com>
2013-04-04 14:27     ` btree vs. linear seach in device mapper Mikulas Patocka
2013-04-04 14:43       ` Joe Thornber [this message]
2013-04-04 23:03         ` Mikulas Patocka
2013-04-08  9:56           ` Joe Thornber

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=20130404144320.GA8207@debian \
    --to=thornber@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.