<div dir="ltr">when I do profiling is it possible to find out if I am spending a lot of time in type conversion?<div>it seems I am not. Also, is it possible to predeclare a type in python? Similar to C: int i=0;</div><div>
<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 15, 2014 at 10:06 PM, Rustom Mody <span dir="ltr"><<a href="mailto:rustompmody@gmail.com" target="_blank">rustompmody@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sunday, February 16, 2014 4:45:04 AM UTC+5:30, Roy Smith wrote:<br>
> In article Cameron Simpson  wrote:<br>
<div class=""><br>
> > On 15Feb2014 12:10, Rita wrote:<br>
> > > i just inherited a large python code base and I would like to optimize the<br>
> > > code (run faster). The application is a scientific application so I really<br>
> > > don't understand the internal logic.<br>
> > [...]<br>
> > One thing I would keep in mind is that scientific applications<br>
> > generally involve floating point math. That is subject to loss of<br>
> > precision if done the wrong way.<br>
<br>
> Another thing to keep in mind is that scientific applications are often<br>
> written by {physicists, chemists, astronomers, etc} who have no clue<br>
> about how floating point math, or indeed much of anything about<br>
> computers, works :-)<br>
<br>
</div>Not exactly my experience.<br>
Most of the {physicists, chemists, astronomers, etc}s I know grok<br>
floating point better than Ive been able to do in 30 years.<br>
They dont get much else though! -- Usually called 'Fortran programmers'.<br>
<br>
The guy who taught me numerical analysis -- a brilliant chemist -- could<br>
never understand why anyone should want to use anything other than Fortran.<br>
And it was a self-evident God's truth that a variable starting with<br>
I-N was integer Rest real.<br>
Declarations??  Pshaw! Sissy stuff!<br>
"I *IS* an integer and no hanky-panky about it"<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>--- <span>Get your facts first, then you can distort them as you please.</span>--
</div>