comp.lang.ada
 help / color / mirror / Atom feed
From: Keean Schupke <keean.schupke@googlemail.com>
Subject: Re: Efficient Sequential Access to Arrays
Date: Mon, 16 Jul 2012 13:44:31 -0700 (PDT)
Date: 2012-07-16T13:44:31-07:00	[thread overview]
Message-ID: <b62a7fa2-e04e-456f-86fa-892bf74899de@googlegroups.com> (raw)
In-Reply-To: <nospam-12F94A.15435316072012@news.aioe.org>

On Monday, 16 July 2012 20:43:54 UTC+1, John B. Matthews  wrote:
>  Keean Schupke wrote:
> 
> &gt; &gt; On Mon, 16 Jul 2012 03:16:09 -0700 (PDT), Keean Schupke wrote:
> &gt; &gt; 
> &gt; &gt; &amp;gt; On Monday, 16 July 2012 08:47:01 UTC+1, Dmitry A. Kazakov  wrote:
> &gt; &gt; &gt; &gt; On Sun, 15 Jul 2012 13:03:12 -0700 (PDT), Keean Schupke wrote:
> &gt; &gt; &gt; &gt;  
> &gt; &gt; &gt; &gt; Absolute figures tell little. How big is the relative difference?
> &gt; &gt; &gt; 
> &gt; &gt; &gt; About 25% (30k with indexing, 40k with relative addressing)
> &gt; &gt; 
> &gt; &gt; Which itself looks like a problem. It takes no less than 25% of 
> &gt; &gt; overall performance for mere shuffling data in a task unrelated to 
> &gt; &gt; stuff like recoding etc. This looks wrong to me. I would look for a 
> &gt; &gt; better algorithm/structure.
> &gt; 
> &gt; I find this comment puzzling and does not match my experience. What 
> &gt; sort of algorithms do you work with. What algorithm for disjoint-set 
> &gt; do you suggest I use? Have a read of this:
> &gt; 
> &gt; http://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf
> 
> Apropos to this, may I impose on you to elaborate on your previous 
> decision not to use WQUPC? In particular, is your application lookup 
> dominated due in some part to the choice of algorithm itself?
> 
> Sorry if I&#39;ve overlooked an intervening clarification.
> 
> &lt;https://groups.google.com/d/msg/comp.lang.ada/EDgDNVw9tgc/bUYu34D_8LEJ&gt;
> 
> &gt; Can you come up with a faster algorithm? Until you have read it I 
> &gt; don&#39;t think you can comment on the quality of algorithm I am using.
> 
> -- 
> John B. Matthews
> trashgod at gmail dot com
> &lt;http://sites.google.com/site/drjohnbmatthews&gt;

That is correct, it is lookup dominated. By joining the smaller set to the lager set and updating the canonical pointer for each node in the smaller set at join time we get better performance for this particular problem.

The second part of the question is harder, is it lookup dominated due to the choice of algorithm? I don't think so. Certainly the choice of Eager-Union vs WUQPC has no influence on the number of lookups.

So the question then becomes what is the wider algorithm, what are we using the disjoint-set to do, but this is getting off topic. The original point was that there exist a class of algorithms for which array indexing is a non-optimal approach to accessing the container. There exists a class of algorithms that require both indexes and linked access within the same data structure, a linked-hash table for example.

So lets try and focus here: Given that such a class of algorithms exist, and for some problems will be optimal, how do we best implement them in Ada?


Cheers,
Keean.




  reply	other threads:[~2012-07-23 10:19 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-15 18:40 Efficient Sequential Access to Arrays Keean Schupke
2012-07-15 19:48 ` Dmitry A. Kazakov
2012-07-15 20:03   ` Keean Schupke
2012-07-15 20:56     ` Keean Schupke
2012-07-16 11:34       ` Jacob Sparre Andersen
2012-07-15 21:05     ` tmoran
2012-07-15 21:08       ` Keean Schupke
2012-07-16  1:19         ` tmoran
2012-07-15 21:44     ` Georg Bauhaus
2012-07-16  7:47     ` Dmitry A. Kazakov
2012-07-16 10:16       ` Keean Schupke
2012-07-16 14:57         ` Dmitry A. Kazakov
2012-07-16 16:39           ` Keean Schupke
2012-07-16 17:02             ` Georg Bauhaus
2012-07-16 18:48             ` Dmitry A. Kazakov
2012-07-16 19:12               ` Keean Schupke
2012-07-17  6:31                 ` Dmitry A. Kazakov
2012-07-17  6:50                   ` Georg Bauhaus
2012-07-17  8:42                     ` Dmitry A. Kazakov
2012-07-17  7:24                   ` Keean Schupke
2012-07-16 19:43             ` John B. Matthews
2012-07-16 20:44               ` Keean Schupke [this message]
2012-07-16 22:23             ` tmoran
2012-07-17  6:40               ` Keean Schupke
2012-07-17  9:01                 ` Dmitry A. Kazakov
2012-07-18  8:10                   ` Keean Schupke
2012-07-18 18:11                     ` tmoran
2012-07-19 10:41                       ` Keean Schupke
2012-07-19 11:18                         ` Georg Bauhaus
2012-07-19 19:58                           ` Keean Schupke
2012-07-21  8:24                             ` Keean Schupke
2012-07-21 11:52                               ` Georg Bauhaus
2012-07-21 16:14                                 ` Keean Schupke
2012-07-21 17:09                                   ` Keean Schupke
     [not found]                                   ` <i78m081tccmp078spmsei1l5vnj3k0kbkj@invalid.netcom.com>
2012-07-22 15:50                                     ` Keean Schupke
2012-07-22  5:13                               ` Shark8
2012-07-15 21:35   ` J-P. Rosen
2012-07-15 19:52 ` Shark8
2012-07-15 20:16   ` Keean Schupke
2012-07-15 21:33     ` Georg Bauhaus
2012-07-17 18:16 ` Florian Weimer
2012-07-22 10:01 ` robin.vowels
2012-07-30  6:31   ` Jacob Sparre Andersen
2012-07-30  7:16     ` Keean Schupke
2012-07-30  9:20     ` Georg Bauhaus
2012-07-30 14:04       ` Keean Schupke
2012-07-22 10:09 ` robin.vowels
2012-07-22 16:02   ` Keean Schupke
2012-07-22 16:21 ` Florian Weimer
2012-07-22 16:46   ` Keean Schupke
2012-07-22 18:41     ` Florian Weimer
2012-07-24  8:21       ` Keean Schupke
2012-07-22 17:34   ` Niklas Holsti
2012-07-22 18:21     ` Keean Schupke
2012-07-30 14:18       ` Jacob Sparre Andersen
2012-07-24 16:00     ` robin.vowels
2012-07-25  7:09       ` Niklas Holsti
2012-07-25  9:03         ` Keean Schupke
2012-07-26  0:15           ` Randy Brukardt
2012-07-26  8:38             ` Keean Schupke
2012-07-26 10:10               ` Brian Drummond
2012-07-26 12:32                 ` Keean Schupke
2012-07-26 13:46                   ` Dmitry A. Kazakov
2012-07-26 17:40                     ` Shark8
2012-07-26 18:56                       ` Dmitry A. Kazakov
2012-07-27  5:25                         ` Shark8
2012-07-27  6:28                           ` Dmitry A. Kazakov
2012-07-27  7:01                             ` Vasiliy Molostov
2012-07-27  8:48                               ` Dmitry A. Kazakov
2012-07-27 12:01                                 ` Georg Bauhaus
2012-07-27 16:49                                 ` Vasiliy Molostov
2012-07-27 19:38                                   ` Dmitry A. Kazakov
2012-07-28  5:32                             ` Shark8
2012-07-28  7:37                               ` Dmitry A. Kazakov
2012-07-28 18:32                                 ` Shark8
     [not found]                     ` <6ov218tnkbqu3vpkuo4t77rd7de0a3aesf@invalid.netcom.com>
2012-07-26 18:49                       ` Dmitry A. Kazakov
     [not found]                         ` <86d31898ne39maimbl24knds7rf38qg7vc@invalid.netcom.com>
2012-07-27  6:45                           ` Dmitry A. Kazakov
2012-07-27  8:21                   ` Keean Schupke
2012-07-27  8:50                     ` Dmitry A. Kazakov
2012-07-27  9:17                       ` Keean Schupke
2013-02-25 21:18                     ` Eryndlia Mavourneen
2012-07-26 13:08               ` Georg Bauhaus
2012-07-26 19:37                 ` stefan-lucks
2012-07-26 19:21               ` stefan-lucks
2012-07-31  3:12               ` Randy Brukardt
2012-07-26  7:11           ` Markus Schöpflin
2012-07-26 14:47         ` Robin Vowels
2012-07-26 15:18           ` Martin
replies disabled

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