<div dir="ltr">Thank you! That is the information I needed.</div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-01 0:18 GMT+01:00 Matthew Brett <span dir="ltr"><<a href="mailto:matthew.brett@gmail.com" target="_blank">matthew.brett@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On Tue, Feb 28, 2017 at 3:04 PM, Sebastian K<br>
<<a href="mailto:sebastiankaster@googlemail.com">sebastiankaster@googlemail.<wbr>com</a>> wrote:<br>
> Yes you are right. There is no need to add that line. I deleted it. But the<br>
> measured heap peak is still the same.<br>
<br>
</span>You're applying the naive matrix multiplication algorithm, which is<br>
ideal for minimizing memory use during the computation, but terrible<br>
for speed-related stuff like keeping values in the CPU cache:<br>
<br>
<a href="https://en.wikipedia.org/wiki/Matrix_multiplication_algorithm" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/<wbr>Matrix_multiplication_<wbr>algorithm</a><br>
<br>
The Numpy version is likely calling into a highly optimized compiled<br>
routine for matrix multiplication, which can load chunks of the<br>
matrices at a time, to speed up computation.   If you really need<br>
minimum memory heap usage and don't care about the order of<br>
magnitude(s) slowdown, then you might need to use the naive method,<br>
maybe implemented in Cython / C.<br>
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
<br>
Matthew<br>
______________________________<wbr>_________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/<wbr>mailman/listinfo/numpy-<wbr>discussion</a><br>
</div></div></blockquote></div><br></div>