Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '16,': 0.03; 'subject:code': 0.07; '*is*': 0.09; 'facts': 0.09; 'inherited': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"i': 0.16; 'brilliant': 0.16; 'math,': 0.16; 'real.': 0.16; 'roy': 0.16; 'simpson': 0.16; 'stuff!': 0.16; 'subject:python': 0.16; 'sat,': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'numerical': 0.19; 'written': 0.21; 'seems': 0.21; 'feb': 0.22; 'email addr:gmail.com>': 0.22; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'integer': 0.24; '---': 0.24; 'cc:2**0': 0.24; '>': 0.26; '15,': 0.26; 'first,': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'rest': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'usually': 0.31; 'anyone': 0.31; 'another': 0.32; 'url:python': 0.33; 'not.': 0.33; 'could': 0.34; 'received:google.com': 0.35; 'really': 0.36; 'done': 0.36; 'url:listinfo': 0.36; 'possible': 0.36; 'similar': 0.36; 'url:org': 0.36; 'should': 0.36; 'wrong': 0.37; 'application': 0.37; 'starting': 0.37; 'loss': 0.38; 'pm,': 0.38; 'anything': 0.39; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'guy': 0.60; 'most': 0.60; 'to:addr:gmail.com': 0.65; 'experience.': 0.67; 'dont': 0.67; 'smith': 0.68; 'subject': 0.69; 'analysis': 0.75; 'article': 0.77; 'truth': 0.81; 'conversion?': 0.84; 'it"': 0.84; 'rita': 0.84; 'subject:base': 0.84; 'taught': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uXf4ltpkSdnLddKoDfCpUeyQdMBxqomzPGHQJj3wJ/0=; b=X/X6+Yhdz0M1W5RXTiX37wmYvfpIhzllGj02QvWYkbl60cTgRSjWG+AVcV5ML0Zl3f d7bSfmPHYqe1ZPfq7LPhQBnLMNjfnrM3qWy5YFL2hc4u5E31UKBywzwUYMLv4oLYsdmK RAwe+ZJ5v67KCf95IUEMlUbVZsFA/jlwRwKuMrhYWEFmwIhGvWnq/Ucg4Elp/FwGUkl1 iFaeR6Ge2iCZWzL7VU4WqnXscFmdWt1rsz9pOdToBvNDeUnxG9IR7rg465qwWeHHc0Xk fRWa2Q6UIhtv0IzNwQCDXzt+vJcwzPsYsvUuU1M+39c7EqahZeCfHtsvc1EtUV+QHHLj O6tQ== MIME-Version: 1.0 X-Received: by 10.60.145.197 with SMTP id sw5mr270942oeb.58.1392555583906; Sun, 16 Feb 2014 04:59:43 -0800 (PST) In-Reply-To: References: Date: Sun, 16 Feb 2014 07:59:43 -0500 Subject: Re: inheriting a large python code base From: Rita To: Rustom Mody Content-Type: multipart/alternative; boundary=047d7b5d4858e8a9ad04f2859cbd Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 112 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392555592 news.xs4all.nl 2918 [2001:888:2000:d::a6]:38756 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66530 --047d7b5d4858e8a9ad04f2859cbd Content-Type: text/plain; charset=ISO-8859-1 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 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.-- --047d7b5d4858e8a9ad04f2859cbd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
when I do profiling is it possible to find out if I am spe= nding 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=3D0;




On Sat, Feb 15, 2014 at 10:06 PM, Rustom Mody <rus= tompmody@gmail.com> wrote:
On Sunday, February 16, 2014 4:45:04 AM UTC+= 5:30, Roy Smith wrote:
> In article Cameron Simpson =A0wrote:

> > On 15Feb2014 12:10, Rita wrote:
> > > i just inherited a large python code base and I would like t= o optimize the
> > > code (run faster). The application is a scientific applicati= on 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 ofte= n
> 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&= #39;.

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?? =A0Pshaw! 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.<= /span>--
--047d7b5d4858e8a9ad04f2859cbd--