<div dir="ltr">Thanks for all the help.<div><br></div><div>That said, I'm not sure it is an issue of the strides. I can easily recreate the slowdown as in the above gist (<span style="font-size:12.8px"> </span><span style="font-variant-ligatures:no-common-ligatures;font-family:Menlo;font-size:11px"><a href="https://gist.github.com/da7b2ef6ef109511af06a9cebbfc8ed1" target="_blank">https://gist.github.com/<wbr>da7b2ef6ef109511af06a9cebbfc8e<wbr>d1</a> )</span>. 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`</div><div><br></div><div>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?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 26, 2017 at 11:06 AM, 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 Sat, Aug 26, 2017 at 12:09 AM, Jonathan Taylor <<a href="mailto:jonathan.taylor@stanford.edu" target="_blank">jonathan.taylor@stanford.edu</a>> wrote:<br>><br></span><span class="">> Yes, it's a dense 2500x2000 matrix.<br>><br>> Loaded strides: (8, 16000)<br>><br>> Copied strides: (20000, 8)<br>><br>> So, matvec is just slower because of strides and where numpy retrieves data? Is there a simple way to do this besides a copy? I can easily afford the copy, just wondering.</span><div><br>It's not simpler, but the most efficient and idiomatic way to ensure C-contiguity is to use np.ascontiguousarray(). This will make a copy only if necessary.<br><br>--<br>Robert Kern</div></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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Jonathan Taylor                          <br>Dept. of Statistics                      <br>Sequoia Hall, 137                          <br>390 Serra Mall<br>Stanford, CA 94305<br>Tel:   650.723.9230<br>Fax:   650.725.8977<br>Web: <a href="http://www-stat.stanford.edu/~jtaylo" target="_blank">http://www-stat.stanford.edu/~jtaylo</a></div>
</div>