optimization question

Andrew Koenig ark at research.att.com
Tue Aug 13 09:13:24 EDT 2002


Steve> Just to get back to your original question, might it not make
Steve> more sense to build the program using a function call or
Steve> equivalent to start with?

Of course.  That's why I asked the question in the first place -- if I
knew that the compiler could be counted on to do the optimization for
me, I wouldn't have to bother, but otherwise I would.

Steve> Seems it would be much easier to go from a function call to
Steve> inline code than vice versa were such a change to be necessary
Steve> for optimization reasons. Also much less likely to be
Steve> inappropriately corrected (since the form you are seeking to
Steve> optimize will obviously appear in other contexts too).

I agree.  I found it surprising that someone would suggest making such
wholesale changes after the fact and counting on unit tests to verify
them all.

Steve> While the deep thought you are clearly accustomed to putting into your
Steve> designs is necessary to make program structures sufficiently simple, too
Steve> much of it might prevent you from implementing anything at all!

:-)  I didn't expect what I thought was a straightforward question to
expand into such a lenghthy discussion.

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list