Hi,
>>> a=N.random.poisson(N.arange(1e6)+1)
>>> U.timeIt('a**2')
0.59
>>> U.timeIt('a*a')
0.01
>>> a.dtype
int32

my U.timeIt function just returns the difference of time in seconds before and 
after evaluation of the string. 
For  
>>> c=N.random.normal(1000, 100, 1e6)
>>> c.dtype
float64
i get .014 seconds  for either c*c or c**2  (I averaged over 100 runs).  After 
converting this to float32 I get 0.008 secs for both.

Can the int32 case be speed up the same way !?

Thanks,
Sebastian Haase


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to