Embedded non-assignable containers

José Armando García Sancio jsancio at gmail.com
Tue Sep 4 09:16:07 PDT 2012


On Sat, Sep 1, 2012 at 6:40 PM, bearophile <bearophileHUGS at lycos.com> wrote:

> José Armando García Sancio:
>
>  I recently read an interesting blog Why should I have written ZeroMQ in C,
>> not C++ (part II) <http://www.250bpm.com/blog:8> by Martin Sústrik. The
>>
>> title is misleading; to me its main observation is that object oriented
>> program may not lead to the most performant implementation.
>>
>
> Isn't he talking about Boost intrusive lists?
>
> http://www.boost.org/doc/libs/**1_51_0/doc/html/intrusive/**
> intrusive_vs_nontrusive.html<http://www.boost.org/doc/libs/1_51_0/doc/html/intrusive/intrusive_vs_nontrusive.html>
>
> Basically.


> One advantage of the NOT intrusive stl list is that if you have to
> transverse the linked list very often, the L1 cache only sees the smal(ler)
> "helpers" (see this image: http://250bpm.wdfiles.com/**
> local--files/blog:8/cpp1.png<http://250bpm.wdfiles.com/local--files/blog:8/cpp1.png>) this probably leads to faster traversal times.
>

Maybe. But I suspect that you are traversing the list to at least read into
the object so I think this become a wash if not worst.


>

On the other hand linked lists are kind of dead, today their need is
> uncommon.
>

How so? Immutable single linked list are nice for multi-threaded
programming. They are heavily used by functional languages like Haskell,
Scala, Clojure, etc.

Bye,
> bearophile
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120904/82028892/attachment.html>


More information about the Digitalmars-d mailing list