Message383613
In what way is it "kludgy"?
There is a mathematical theorem that states that generated code will be imperfect,
so we will have to live with that :)
https://en.wikipedia.org/wiki/Full_employment_theorem
3.10a produces more efficient bytecode than 3.9.
3.9:
2 0 LOAD_GLOBAL 0 (range)
2 LOAD_CONST 1 (10)
4 CALL_FUNCTION 1
6 GET_ITER
>> 8 FOR_ITER 8 (to 18)
10 STORE_FAST 0 (i)
3 12 POP_TOP
14 JUMP_ABSOLUTE 18
16 JUMP_ABSOLUTE 8
4 >> 18 LOAD_CONST 2 (17)
20 RETURN_VALUE
3.10a:
2 0 LOAD_GLOBAL 0 (range)
2 LOAD_CONST 1 (10)
4 CALL_FUNCTION 1
6 GET_ITER
8 FOR_ITER 8 (to 18)
10 STORE_FAST 0 (i)
3 12 POP_TOP
4 14 LOAD_CONST 2 (17)
16 RETURN_VALUE
>> 18 LOAD_CONST 2 (17)
20 RETURN_VALUE |
|
Date |
User |
Action |
Args |
2020-12-22 20:46:01 | Mark.Shannon | set | recipients:
+ Mark.Shannon, rhettinger, nedbat |
2020-12-22 20:46:01 | Mark.Shannon | set | messageid: <1608669961.21.0.502202364344.issue42696@roundup.psfhosted.org> |
2020-12-22 20:46:01 | Mark.Shannon | link | issue42696 messages |
2020-12-22 20:46:01 | Mark.Shannon | create | |
|