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