<div class="gmail_quote">On Wed, Dec 22, 2010 at 9:07 AM, Francesc Alted <span dir="ltr"><<a href="mailto:faltet@pytables.org">faltet@pytables.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
A Wednesday 22 December 2010 17:25:13 Mark Wiebe escrigué:<br>
<div class="im">> Can you print out your np.__version__, and try running the tests?  If<br>
> newiter didn't build for some reason, its tests should be throwing a<br>
> bunch of exceptions.<br>
<br>
</div>I'm a bit swamped now.  Let's see if I can do that later on.<br></blockquote><div> </div><div>Ok.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
> > I see :-)  Well, I'd think that numexpr is not specially efficient<br>
> > when handling broadcasting, so this might be the reason your<br>
> > approach is faster.  I suppose that with operands with the same<br>
> > shape, things might look different.<br>
><br>
> I haven't looked at the numexpr code, but I think the ufuncs will<br>
> need SSE versions to make up part of the remaining difference.<br>
<br>
</div>Uh, I doubt that SSE can do a lot for accelerating operations like<br>
3*a+b-(a/c), as this computation is mainly bounded by memory (although<br>
threading does certainly help).  Numexpr can use SSE only via Intel's<br>
VML, which is very good for accelerating the computation of<br>
transcendental functions (sin, cos, sqrt, exp, log...).<br></blockquote><div><br></div><div>The reason I think it might help is that with 'luf' is that it's calculating the expression on smaller sized arrays, which possibly just got buffered.  If the memory allocator for the temporaries keeps giving back the same addresses, all this will be in one of the caches very close to the CPU.  Unless this cache is still too slow to feed the SSE instructions, there should be a speed benefit.  The ufunc inner loops could also use the SSE prefetch instructions based on the stride to give some strong hints about where the next memory bytes to use will be.</div>
<div><br></div><div>-Mark</div></div>