comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: B-Tree v Skip-List Insertion Benchmark
Date: Thu, 18 Sep 2014 09:41:58 +0200
Date: 2014-09-18T09:41:58+02:00	[thread overview]
Message-ID: <1x1p8c1ys7ely$.d0rvczpoa0kb$.dlg@40tude.net> (raw)
In-Reply-To: lvdbn4$99j$1@dont-email.me

On Wed, 17 Sep 2014 18:15:15 -0700, Jeffrey Carter wrote:

> I ran a quick comparison of the insertion times for Kazakov's Generic_B_Tree pkg
> against PragmARC.Skip_List_Unbounded from the PragmAda Reusable Components.
> 
> Both data structures are used for similar purposes, allowing O(log N) look-up
> times. Insertion and deletion are expensive operations on balanced trees due to
> re-balancing, and one reason skip lists were invented was to have fast insertion
> and deletion times compared to balanced trees. I had never actually compared
> times, and Kazakov's recent post comparing DB times got me thinking about it.
> 
> A typical run inserting the same 1,000 items into both structures gives times of
> 
> 1.484 ms for the B tree
> 0.709 ms for the skip list
> 
> (Divide by 1,000 for average per-insertion times.)
> 
> The trade off is similar to using heap sort or quick sort. Both are O(N log N),
> with quick sort usually being faster. Heap sort is always O(N log N), but in
> rare cases, however, quick sort has worst-case performance of O(N**2).
> 
> A skip list is probabilistically balanced, and has a worst-case search time of
> O(N) in very rare circumstances, almost always for small N (< 256).

Thanks for pointing this.

Can skip list made fit into a series fixed-size blocks?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2014-09-18  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  1:15 B-Tree v Skip-List Insertion Benchmark Jeffrey Carter
2014-09-18  7:41 ` Dmitry A. Kazakov [this message]
2014-09-18 16:53   ` Jeffrey Carter
2014-09-18 17:54     ` Dmitry A. Kazakov
2014-09-18 19:33       ` Jeffrey Carter
2014-09-18 20:31         ` Dmitry A. Kazakov
2014-09-18 17:39   ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox