On Sat, Sep 1, 2012 at 6:40 PM, bearophile <span dir="ltr"><<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
José Armando García Sancio:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
I recently read an interesting blog Why should I have written ZeroMQ in C,<br></div>
not C++ (part II) <<a href="http://www.250bpm.com/blog:8" target="_blank">http://www.250bpm.com/blog:8</a>> by Martin Sústrik. The<div class="im"><br>
title is misleading; to me its main observation is that object oriented<br>
program may not lead to the most performant implementation.<br>
</div></blockquote>
<br>
Isn't he talking about Boost intrusive lists?<br>
<br>
<a href="http://www.boost.org/doc/libs/1_51_0/doc/html/intrusive/intrusive_vs_nontrusive.html" target="_blank">http://www.boost.org/doc/libs/<u></u>1_51_0/doc/html/intrusive/<u></u>intrusive_vs_nontrusive.html</a><br>
<br></blockquote><div>Basically.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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: <a href="http://250bpm.wdfiles.com/local--files/blog:8/cpp1.png" target="_blank">http://250bpm.wdfiles.com/<u></u>local--files/blog:8/cpp1.png</a> ) this probably leads to faster traversal times.<br>
</blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On the other hand linked lists are kind of dead, today their need is uncommon.<br></blockquote><div><br></div><div>How so? Immutable single linked list are nice for multi-threaded programming. They are heavily used by functional languages like Haskell, Scala, Clojure, etc. </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Bye,<br>
bearophile<br>
</blockquote></div><br>