Mark Lawrence breamore...@yahoo.co.uk added the comment:
Closing as nobody has commented.
--
nosy: +BreamoreBoy
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2181
Antoine Pitrou pit...@free.fr added the comment:
Given that it is unlikely to give any speedup in real-world code, I
don't think we should add complexity to the compiler. Recommend closing.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
Changes by Sean Reifschneider [EMAIL PROTECTED]:
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2181
__
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Sean Reifschneider [EMAIL PROTECTED]:
--
assignee: - nnorwitz
priority: - normal
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2181
__
___
Armin Rigo added the comment:
I view this as a problem with Psyco, not with the user code.
An even deeper reason for which the general optimization would break
code is because it changes the lifetime of objects. For example, Psyco
contains specific, user-requested support to make sure the
Armin Rigo added the comment:
I suppose you are aware that performing this optimization in general
would break a lot of existing code that uses inspect.getstack() or
sys._getframe() to peek at the caller's local variables. I know this
because it's one thing that Psyco doesn't do correctly, and
Neal Norwitz added the comment:
I suppose you are aware that performing this optimization in general
would break a lot of existing code that uses inspect.getstack() or
sys._getframe() to peek at the caller's local variables. I know this
Yes, with this optimization the variable might
New submission from Neal Norwitz:
This patch optimizes code like:
x = any_expression
return x
to:
return any_expression
Currently it only optimizes out the local variable if there is a return
because it can't determine if this is the last use of the variable or not.
This shouldn't
Neal Norwitz added the comment:
I forgot to mention that if another loop was added to PyCode_Optimize
that kept track of the # of times each local variable was
LOAD_FAST/STORE_FAST/DELETE_FAST and that the count was 2, we could
perform a similar optimization without requiring the return.
Bonus
Neal Norwitz added the comment:
I forgot to mention that if another loop was added to PyCode_Optimize
that kept track of the # of times each local variable was
LOAD_FAST/STORE_FAST/DELETE_FAST and that the count was 2, we could
perform a similar optimization without requiring the return.
Bonus
Neal Norwitz added the comment:
Guido says to do it only with -O.
http://mail.python.org/pipermail/python-dev/2008-February/077193.html
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2181
__
11 matches
Mail list logo