LWN.net Logo

Quotes of the week

I have always felt uncomfortable with *any* kind of optimization -- whether AST-based or bytecode-based. I feel the cost in code complexity is pretty high and in most cases the optimization is not worth the effort. Also I don't see the point in optimizing expressions like "3 * 4 * 5" in Python. In C, this type of thing occurs frequently due to macro expansion and the like, but in Python your code usually looks pretty silly if you write that. So this is basically a solution to a non-problem.
-- Guido van Rossum

Compiler warnings should be programmers' assistants, not their masters.
-- Richard Stallman

The right thing to do with almost all open source software is to assume that it is fixed in newer code, then you try the newer code, and if the problem remains then you can tell us.
-- Theo de Raadt

I would prefer scripting, but having to install Perl CPAN modules and all their dependencies is more work than downloading a .tar.gz file from openssl.org, adding eight characters to one line, and doing "./config; make"
-- Wietse Venema
(Log in to post comments)

costs of not optimizing

Posted Mar 20, 2011 6:59 UTC (Sun) by pjm (subscriber, #2080) [Link]

A cost of not implementing an optimization in the compiler is that programmers must then evaluate the readability vs performance tradeoff themselves: spending thought on the decision, and sometimes making the wrong decision.

For the case at hand, "3 * 4 * 5" might not often occur in programs, but "7 * 24 * 60 * 60" might, and that's much more readable than "604800", even with a comment nearby. So "non-problem" is a slight exaggeration.

(I agree that implementing an optimization also has costs. I mention the above as one factor to consider for decisions about optimizations in compilers.)

costs of not optimizing

Posted Mar 22, 2011 10:11 UTC (Tue) by k8to (subscriber, #15413) [Link]

The point is python code already doesn't have that pattern.

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds