Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8313

performance critical Python features

Date 2011-06-23 10:58 -0600
Subject performance critical Python features
From Eric Snow <ericsnowcurrently@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.330.1308848288.1164.python-list@python.org> (permalink)

Show all headers | View raw


I was thinking about the different features of Python that have an
impact on performance.  Here are the obvious ones I could think of:

Features most impactful on performance:

- function calls
- loops

Features least impactful on performance:

- imports
- function definitions
- class definitions

A key point is that CPython has special-case optimization for
functions (code objects, locals, and eval) and loops (comprehensions,
generators, and iterators).  Also, other libraries are optimized via
C-extensions to be efficient, I expect due to their use in loops.  In
contrast to that, the machinery behind language features like imports
are moving to pure Python.

So, which are the other pieces of Python that really need the heavy
optimization and which are those that don't?  Thanks.

-eric

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

performance critical Python features Eric Snow <ericsnowcurrently@gmail.com> - 2011-06-23 10:58 -0600

csiph-web