IMHO (I'm 99.999% sure Andrei will disagree with me) if you really want to exploit every possible micro-optimization you shouldn't be using generic code in the first place. The ability to write generic code that's as efficient as the equivalent hand-written code is a major achievement of templates. However, if you know your data and use cases inside out and care about getting every last bit of performance, you won't write equivalent hand-written code, you'll write super micro-optimized hand-written code tailored to the data and use case. There are almost always opportunities for ad-hoc micro-optimization, though whether they are worth implementing in any given case is a different question.<br>
<br><div class="gmail_quote">On Fri, Aug 13, 2010 at 2:00 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisprog@gmail.com">jmdavisprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Friday, August 13, 2010 10:32:11 David Simcha wrote:<br>
> I would agree if we were talking about big-O efficiency, or even a large<br>
> constant overhead, but IMHO avoiding Slicer is a micro-optimization, not a<br>
> macro-optimization. Therefore, by default it should "just work" even if<br>
> it's slightly inefficient and intervention should be required only if the<br>
> programmer decides it needs to be optimized.<br>
<br>
</div>Well, if it's deemed that it's not a big difference, then I don't think that I<br>
really have a problem with it. It bugs me a bit still, but that doesn't mean<br>
that it's a bad idea. We definitely need std.algorithm to generally be efficient,<br>
but we also need it to be useable. So, if the cost in efficiency is small enough,<br>
and there really are a lot of ranges that have this problem, then Slicer<br>
probably should be used.<br>
<div><div></div><div class="h5"><br>
- Jonathan M Davis<br>
_______________________________________________<br>
phobos mailing list<br>
<a href="mailto:phobos@puremagic.com">phobos@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/phobos" target="_blank">http://lists.puremagic.com/mailman/listinfo/phobos</a><br>
</div></div></blockquote></div><br>