<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 23, 2013, at 6:52 PM, Scott Dial <<a href="mailto:scott+python-dev@scottdial.com">scott+python-dev@scottdial.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">Nowadays, cache lines are still 64 bytes but pointers are 8 bytes, and</span><br style="font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">we still allocating on 16 byte alignment, so you have a 25% chance of a</span><br style="font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">cache miss now.</span></blockquote><div><br></div>Honestly, I'm not sure what you're arguing for or against.</div><div><br></div><div>The struct should to be reordered so that the leftmost data element</div><div>and left link are positioned side-by-side, and the same goes for the</div><div>rightmost element and right link.</div><div><br></div><div>Whether the blocksize should change is debatable.</div><div>It causes an unfortunate odd-size at the end (not good for</div><div>the final cache line), but it does improve the speed of the </div><div>deque_index() code.  The former seems to make no difference</div><div>in timings while the latter gives a measureable speed-up.</div><div><br></div><div>Unfortunately, I'm losing interest in this part of the deque work.</div><div>I've already invested substantial time reading papers</div><div>(such as <a href="http://www.akkadia.org/drepper/cpumemory.pdf">http://www.akkadia.org/drepper/cpumemory.pdf</a></div><div>and <a href="http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html">http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html</a>),</div><div>analyzing the code, reading disassembly, and making timings.</div><div>But it isn't worth all the second guessing (and what feels like sniping).</div><div>I've worked on this code for almost a decade.  As far as I can tell, none</div><div>of the participants in this thread has ever previously shown any interest</div><div>in the deque object.  It is discouraging to have a simple parameter </div><div>change and struct reordering reverted.  This thread has offered zero </div><div>support or encouragement for my work.  The python-dev </div><div>social environment appears to be degrading over time.</div><div>I only have a few hours of development time each week</div><div>and now I'm wasting that time responding to these emails</div><div>(it may go with the territory, but it is a waste none-the-less).</div><div><br></div><div>If it is what you guys what, then leave the code as is</div><div>(with an incorrect comment, a blocklen that is unfavorable</div><div>to indexing, and a struct order that doesn't exploit</div><div>cache locality by following the natural access patterns</div><div>in the code).</div><div><br></div><div>I understand that the code for Py2.7 is sensitive and understand</div><div>if you all prefer to leave it untouched. </div><div><br></div><div><br></div><div><br></div><div>Raymond</div><div><br></div><div><br></div><div>P.S. This has all arisen in context of my working on patch</div><div>for implementing slicing for deques.  In that context, the</div><div>code for deque_item() and deque_rotate() will become</div><div>more important than they were before.   Along the way,</div><div>I am re-examining all my existing code.</div><div><br></div><div><br></div><div><br></div><div><br></div></body></html>