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


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

Re: Early binding as an option

Started byGelonida N <gelonida@gmail.com>
First post2011-08-03 00:54 +0200
Last post2011-08-03 00:54 +0200
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: Early binding as an option Gelonida N <gelonida@gmail.com> - 2011-08-03 00:54 +0200

#10771 — Re: Early binding as an option

FromGelonida N <gelonida@gmail.com>
Date2011-08-03 00:54 +0200
SubjectRe: Early binding as an option
Message-ID<mailman.1810.1312325666.1164.python-list@python.org>
On 08/03/2011 12:26 AM, Chris Angelico wrote:
> On Tue, Aug 2, 2011 at 11:21 PM, Gelonida N <gelonida@gmail.com> wrote:
>> On the other hand: It might be interesting, that the early binding would
>> just take place when python is invoked with -O
>>
> 
> This could be an excellent safety catch, but on the other hand, it
> might destroy all value of the feature - once again, it would be
> optimizing in the sole case where the code is probably better
> rewritten in C.
> 
> Or would this be a sort of "half-way house" - this is where we need
> more performance, let's spend two minutes tweaking it in Python rather
> than dropping to C - to get some of the performance gains?

Not really sure.

I would guess, that really tight inner loops should be rewritten with
Cython (never tried it though) or in C if performance is really that
critical.

On the other hand it could be nice to get a certain performance increase
with some pragmas without rendering the code completely unreadable.

I have loads of places in my code, where name lookups were required only
at compile time or at the first time when code is executed.

For every consecutive call a cached object-reference could be used.



[toc] | [standalone]


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


csiph-web