Reference
Rhodri James
rhodri at wildebst.org.uk
Tue Mar 4 20:08:57 EST 2014
On Tue, 04 Mar 2014 05:24:03 -0000, Chris Angelico <rosuav at gmail.com>
wrote:
> Code should look like its intent. Warping it around performance is
> hardly ever worthwhile.
That depends. In Python, I'd agree with you; if I'm worrying about
performance in Python, I'm worrying at the level of the algorithms I'm
using. In a constrained embedded C environment, which is where I spend
most of my working life, writing your code so that the compiler chooses
the right optimisation is critical. Sometimes it matters a great deal to
me that something like "x *= 5" compiles to a single ARM instruction, or
that splitting a loop into two to avoid a conditional test will let an
DSP's optimiser double the speed of a section of code.
--
Rhodri James *-* Wildebeest Herder to the Masses
More information about the Python-list
mailing list