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


Groups > comp.lang.python > #25732 > unrolled thread

Re: Basic question about speed/coding style/memory

Started byAndrew Berg <bahamutzero8825@gmail.com>
First post2012-07-21 04:05 -0500
Last post2012-07-21 04:05 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Basic question about speed/coding style/memory Andrew Berg <bahamutzero8825@gmail.com> - 2012-07-21 04:05 -0500

#25732 — Re: Basic question about speed/coding style/memory

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2012-07-21 04:05 -0500
SubjectRe: Basic question about speed/coding style/memory
Message-ID<mailman.2371.1342861536.4697.python-list@python.org>
On 7/21/2012 3:13 AM, Jan Riechers wrote:
> Cause, as I understand the interpreter chooses either the "else" (1st 
> block) or just proceeds with following code outside the if.
If none of the if/elif statements evaluate to something true, the else
block is executed.

> So if there is some overhead in some fashion in case we don't offer the 
> else, assuming the interpreter has to exit the evaluation of the 
> "if"-statement clause and return to a "normal parsing code"-state 
> outside the if statement itself.
I really don't understand. You can look into the dis module if you want
to look at how CPython bytecode is executed and the timeit module to
measure speed. In any case, I don't see how there would be any
significant difference.

http://docs.python.org/py3k/library/dis.html
http://docs.python.org/py3k/library/timeit.html
-- 
CPython 3.3.0b1 | Windows NT 6.1.7601.17803

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web