[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your tests Josh. I have collected additional statistics. According to it CHAINED_COMPARE_OP would be used 100 times less than COMPARE_OP. This is not worth adding new opcode. -- resolution: -> rejected stage: patch review -> resolved

[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: It is a little funny though. I expect a more common test like: if a < b < c: pass to be unconditionally faster than the logically equivalent: if a < b and b < c: pass The only difference between the two should be that b is loaded only once, which should make

[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-05 Thread Demur Rumed
Demur Rumed added the comment: @rhettinger can you clarify your opinion in relation to #27140 with #27095 & #27213 in mind? I agree that CHAINED_COMPARE_OP is unnecessary -- ___ Python tracker ___

[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please stop adding new opcodes for rare use cases. That represents a sharp departure from our entire history of adding opcodes. Code like "x = a < b > c < d" almost never comes up. -- nosy: +rhettinger ___ Pytho

[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now complex code is generated for chained comparing. $ echo "x = a < b > c < d" | ./python -m dis 1 0 LOAD_NAME0 (a) 2 LOAD_NAME1 (b) 4 DUP_TOP 6 ROT_THREE