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 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 files: opt-out-local-var.patch keywords: patch, patch messages: 62957 nosy: nnorwitz severity: normal status: open 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 <[EMAIL PROTECTED]> <http://bugs.python.org/issue2181> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com