[New-bugs-announce] [issue2181] optimize out local variables at end of function
report at bugs.python.org
Mon Feb 25 03:00:14 CET 2008
New submission from Neal Norwitz:
This patch optimizes code like:
x = 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 change behaviour under normal circumstances, but would
change behaviour with a debugger. Perhaps this optimization should only
be performed if -O is passed on the command line?
This optimization saves two trips around the eval loop (STORE_FAST and
LOAD_FAST) and 6 bytes in the byte code.
components: Interpreter Core
keywords: patch, patch
title: optimize out local variables at end of function
type: resource usage
Added file: http://bugs.python.org/file9544/opt-out-local-var.patch
Tracker <report at bugs.python.org>
More information about the New-bugs-announce