<div dir="ltr">Hi Danny,<div>I followed your suggestion.</div><div>Tomorrow morning I will run this new version of the code.</div><div><br></div><div>Now using a sample of 81 elements (instead of 600000) the profile returns:</div>
<div><br></div><div><div>Thu Apr 10 23:25:59 2014    restats</div><div><br></div><div>         18101188 function calls in 1218.626 seconds</div><div><br></div><div>   Ordered by: internal time</div><div>   List reduced from 13 to 10 due to restriction <10></div>
<div><br></div><div>   ncalls  tottime  percall  cumtime  percall filename:lineno(function)</div><div>        1 1015.803 1015.803 1218.334 1218.334 skymaps5.py:44(mymain)</div><div> 18101000  202.490    0.000  202.490    0.000 {method 'write' of 'file' objects}</div>
<div><br></div><div>        1    0.292    0.292 1218.626 1218.626 <string>:1(<module>)</div><div>        6    0.029    0.005    0.029    0.005 {open}</div><div>        5    0.010    0.002    0.010    0.002 {method 'close' of 'file' objects}</div>
<div><br></div><div>       81    0.002    0.000    0.002    0.000 {method 'split' of 'str' objects}</div><div>       82    0.001    0.000    0.001    0.000 {zip}</div><div>        1    0.000    0.000    0.000    0.000 function_base.py:8(linspace)</div>
<div>        1    0.000    0.000    0.000    0.000 function_base.py:93(logspace)</div><div>        5    0.000    0.000    0.000    0.000 {numpy.core.multiarray.zeros}</div><div><br></div></div><div><br></div><div>Anyway I would like to try to speed it up using C functions (and maybe comparing the resuts of the two profile in the end)</div>
<div>How can I do it now? Can I use Cython?</div><div><br></div><div>Thanks</div><div><br></div><div>Gabriele</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-10 21:38 GMT-04:00 Danny Yoo <span dir="ltr"><<a href="mailto:dyoo@hashcollision.org" target="_blank">dyoo@hashcollision.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">> Comment:  You are looping over your sliced eel five times.  Do you<br>
>    need to?  I like eel salad a great deal, as well, but, how about:<br>
><br>
><br>
>        for k in eel:<br>
>            MYMAP1[i, j, k] = MYMAP1[i, j, k] + myinternet[oo]<br>
>            MYMAP2[i, j, k] = MYMAP2[i, j, k] + myinternet[oo]<br>
>            MYMAP3[i, j, k] = MYMAP3[i, j, k] + myinternet[oo]<br>
>            MYMAP4[i, j, k] = MYMAP4[i, j, k] + myinternet[oo]<br>
>            MYMAP5[i, j, k] = MYMAP5[i, j, k] + myinternet[oo]<br>
>            oo = oo + 1<br>
<br>
<br>
</div>Hi Gabriele,<br>
<br>
Also note that, when Martin looked at this part of the code, he<br>
unfortunately misinterpreted its effect; Martin's proposed rewrite<br>
here does not preserve the meaning of the original code.  But rather<br>
than wag my finger at how Martin interpreted the code, I'd rather make<br>
the observation that this is a warning sign that the original code<br>
here was not easy to understand.<br>
</blockquote></div><br></div>