<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>
<br><div><div>On Oct 4, 2012, at 3:59 AM, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Calibri; font-size: 16px; ">vector<int> is small, contains 3 pointers.<br>And one level of indirection for accessing the data.<br>printf("%d\n", vi[0]); has one level of indirection and will be inlined in any decent compiler.<br></span></span></blockquote><div><br></div>Probably because preprocessor is in this equation?</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Calibri; font-size: 16px; "><br><br><br>IntSeq.T is one pointer, and probably contains also approximately 3 pointers.<br>The Modula-3 has an extra level of indirection.<br></span></span></blockquote><div><br></div>And what is vector<int> if not pointer to some collection of pointers? </div><div><br></div><div>IntSeq is generic instantiation. Calls can be inlined by decent compiler. There lies probable reason for generics in Modula-3. So efficiency junkies can have their way :).</div><div><br></div><div>In my opinion, Moore's law combined with lives of my applications usually being longer than Moore's interval does all the extra speed magic I need.</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Calibri; font-size: 16px; "><br><br>Not every function should be "virtual".<br>"object.method" is useful syntax for statically typed "object".<br>s.get(0) probably involves like 3 pointer derefences.</span></span></blockquote><br></div><div>As opossed to C++'s two dereferences?</div><br></body></html>