<div dir="ltr">I tried reproducing the results from your gist using scipy 0.19.0, and I found that Xmat is aligned after loadmat:<div><br></div><div><div>In [3]: Xmat = sio.loadmat('data.mat')['X']</div><div><br></div><div>In [4]: Xmat.flags</div><div>Out[4]: </div><div>  C_CONTIGUOUS : False</div><div>  F_CONTIGUOUS : True</div><div>  OWNDATA : False</div><div>  WRITEABLE : True</div><div>  ALIGNED : True</div><div>  UPDATEIFCOPY : False</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 28, 2017 at 1:26 PM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">On Mon, Aug 28, 2017 at 10:13 AM, Jonathan Taylor <<a href="mailto:jonathan.taylor@stanford.edu" target="_blank">jonathan.taylor@stanford.edu</a>> wrote:<br>><br>> Thanks for all the help.<br>><br>> That said, I'm not sure it is an issue of the strides. I can easily recreate the slowdown as in the above gist ( <a href="https://gist.github.com/da7b2ef6ef109511af06a9cebbfc8ed1" target="_blank">https://gist.github.com/<wbr>da7b2ef6ef109511af06a9cebbfc8e<wbr>d1</a> ). Also, modifying the flags of a user-created ndarray so they agree with the loaded one is still noticably faster than using the array from `scipy.io.loadmat`<br><br></span>Ah yeah, if the data is aligned, then that might end up faster. Your optimized BLAS will be able to use certain CPU instructions that require aligned data. Setting the ALIGNED flag to false won't actually make the data unaligned; your BLAS checks the data itself, not the numpy flag.<span class=""><br><br>> For my purposes, a copy is just fine, but I think this might be an issue that could be looked into. Perhaps I should file an issue on github?<br><br></span>It might be worth checking if scipy.io.loadmat() can be made to ensure that it always creates aligned arrays. There isn't anything to be done about .dot(), though.<br><br>--<br>Robert Kern</div>
<br>______________________________<wbr>_________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scipy-dev</a><br>
<br></blockquote></div><br></div>