[issue39156] Break up COMPARE_OP into logically distinct operations.

2020-01-14 Thread Mark Shannon
Mark Shannon added the comment: New changeset 9af0e47b1705457bb6b327c197f2ec5737a1d8f6 by Mark Shannon in branch 'master': bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754) https://github.com/python/cpython/commit/9af0e47b1705457bb6b327c197f2ec5737a1d8f6

[issue39156] Break up COMPARE_OP into logically distinct operations.

2020-01-14 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-30 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +17190 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17754 ___ Python tracker ___

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-30 Thread Mark Shannon
Mark Shannon added the comment: Moving work from the interpreter to the compiler is always a good idea. Performance: The compiler is run once per code unit, the interpreter thousands or millions of times. The compiler is easier to test. Just match the expected bytecode with the actual

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Introducing new opcodes will complicate the compiler. And it will complicate opcode.py and peephole.c and anything else that touches the word codes. -- ___ Python tracker

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Few years ago I experimented with a special opcode for exception matching. It could make the bytecode a tiny bit smaller and faster, but since catching an exception in Python is relatively expensive, it would not have significant performance benefit. As

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: When COMPARE_OP occurs in a loop, the dispatch tends to be branch predictable. So there may not be real-world performance benefit to splitting the opcodes. -- nosy: +rhettinger ___ Python tracker

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think is a good idea, being the only problem that I see that as the opcode targets are limited we would be burning 3 more. I specially like the proposal for JUMP_IF_NOT_EXC_MATCH as PyCmp_EXC_MATCH is only used in the code for the try-except and is

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Mark Shannon
New submission from Mark Shannon : Currently the COMPARE_OP instruction performs one of four different tasks. We should break it up into four different instructions, that each performs only one of those tasks. The four tasks are: Rich comparison (>, <, ==, !=, >=, <=) Identity comparison