[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Alexander Belopolsky

New submission from Alexander Belopolsky <[EMAIL PROTECTED]>:

When peephole optimizer folds multiple constants into one, the old 
constants remain in co_consts.  Attached patch removes such unused 
constants.

--
components: Interpreter Core
files: compress-consts.diff
keywords: patch
messages: 64558
nosy: belopolsky
severity: normal
status: open
title: Remove unused constants from optimized code objects
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file9867/compress-consts.diff

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Raymond Hettinger

Changes by Raymond Hettinger <[EMAIL PROTECTED]>:


--
assignee:  -> rhettinger
nosy: +rhettinger

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

I've noticed that the original patch does not handle the error condition 
from failed consts resize correctly.  Please see compress-consts-1.diff 
for a fix.

Added file: http://bugs.python.org/file9868/compress-consts-1.diff

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2493] Remove unused constants from optimized code objects

2008-06-12 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

The issue with unused constants is an artifact of the peepholer running 
after the bytecode generation phase.  When constant folding was 
written, I intentionally left-out a step to remove unused constants 
because of the code complexity, the fragility of the process, because 
the benefits were inconsequential, and because it added to compilation 
time.  

It would be better to wait for the AST optimizer to replace the 
peepholer.  AST optimizations are upstream from bytecode generation, so 
the unused constant issue simply disappears.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com