Message315633
There seems to be an implicit assumption here that fewer bytecodes is better. But that isn't always the case.
Do you have evidence that the sequence
0 LOAD_CONST 5 ((('a', 'b', 'c'), 3, 2, 1))
2 UNPACK_SEQUENCE 4
is actually faster than
0 LOAD_CONST 0 (1)
2 LOAD_CONST 1 (2)
4 LOAD_CONST 2 (3)
6 LOAD_CONST 3 (('a', 'b', 'c'))
?
The second sequence has more bytecodes, but the first has to create a new object.
I think you ought to be careful using the word "optimize" unless the output is incontrovertibly superior. |
|
Date |
User |
Action |
Args |
2018-04-22 23:42:12 | Mark.Shannon | set | recipients:
+ Mark.Shannon, brett.cannon, rhettinger, ncoghlan, pitrou, benjamin.peterson, methane, serhiy.storchaka, yselivanov |
2018-04-22 23:42:12 | Mark.Shannon | set | messageid: <1524440532.8.0.682650639539.issue33325@psf.upfronthosting.co.za> |
2018-04-22 23:42:12 | Mark.Shannon | link | issue33325 messages |
2018-04-22 23:42:12 | Mark.Shannon | create | |
|