Port a benchmark to D?
Jonathan M Davis
jmdavisProg at gmx.com
Mon Jun 6 08:57:56 PDT 2011
On 2011-06-06 06:37, Steven Schveighoffer wrote:
> On Fri, 03 Jun 2011 17:30:54 -0400, Timon Gehr <timon.gehr at gmx.ch> wrote:
> > Jonathan M Davis wrote:
> >> On 2011-06-03 14:08, Timon Gehr wrote:
> >> > Andrei Alexandrescu wrote:
> >> > > I noticed that the C++ code uses std::list without there being any
> >>
> >> need
> >>
> >> > > for a linked list structure. See for example the data structure
> >>
> >> used in
> >>
> >> > > FindSet. It's a list, but it's just appended too and then used for
> >>
> >> one
> >>
> >> > > iteration.
> >> > >
> >> > > Andrei
> >> >
> >> > Yes, but the list in FindSet is unnecessary anyways. If I start
> >>
> >> changing
> >>
> >> > the original implementation, the first thing I will do is to remove
> >>
> >> that.
> >>
> >> > First however, I will port the code as closely as possible. Is there
> >>
> >> any
> >>
> >> > associative version of RedBlackTree (I realize it could be made
> >>
> >> associative
> >>
> >> > quite easily), or should I just use built-in hash maps?
> >>
> >> You give RedBlackTree a different predicate if you want to treat it as
> >> a map.
> >> It defaults to "a < b" with allowDuplicates as false, which makes it a
> >> multiset.
>
> This makes it a set, not a multiset. allowDuplicates set to true would
> make it a multiset.
Bleh. You're right. I guess that I wasn't thinking straight (or was thinking
too quickly) on that one. :(
- Jonathan M Davis
More information about the Digitalmars-d
mailing list