This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年03月26日 14:47 by belopolsky, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| compress-consts.diff | belopolsky, 2008年03月26日 14:47 | Patch against revision 61948 | ||
| compress-consts-1.diff | belopolsky, 2008年03月26日 15:31 | Patch against revision 61948 | ||
| Messages (3) | |||
|---|---|---|---|
| msg64558 - (view) | Author: Alexander Belopolsky (belopolsky) * (Python committer) | Date: 2008年03月26日 14:47 | |
When peephole optimizer folds multiple constants into one, the old constants remain in co_consts. Attached patch removes such unused constants. |
|||
| msg64561 - (view) | Author: Alexander Belopolsky (belopolsky) * (Python committer) | Date: 2008年03月26日 15:31 | |
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. |
|||
| msg68101 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2008年06月12日 22:08 | |
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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:32 | admin | set | github: 46745 |
| 2008年06月12日 22:08:50 | rhettinger | set | status: open -> closed resolution: rejected messages: + msg68101 |
| 2008年03月26日 15:31:22 | belopolsky | set | files:
+ compress-consts-1.diff messages: + msg64561 |
| 2008年03月26日 15:06:16 | rhettinger | set | assignee: rhettinger nosy: + rhettinger |
| 2008年03月26日 14:47:35 | belopolsky | create | |