[issue43684] Add combined opcodes

2021-04-06 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, I've received many warnings about benchmark hacking already, and we won't fall to that. For static statistics, it's easy enough to either download a thousand of the most popular projects from GitHub or PyPI and just try to compile all the .py files fou

[issue43684] Add combined opcodes

2021-04-06 Thread Brandt Bucher
Brandt Bucher added the comment: > I collected a few different sets of statistics: static stats for the stdlib > and for mypy, dynamic stats for running mypy and a few of the benchmarks in > pyperformance. I'm sure you've considered this, but I'd be *very* careful using opcode stats from th

[issue43684] Add combined opcodes

2021-04-06 Thread Guido van Rossum
Guido van Rossum added the comment: > Interesting. What code did you use to collect statistics? For static statistics I wrote my own script: https://github.com/python/cpython/pull/25090/files#diff-994d3592c951c78cbe71084d562590d1507ddfed767e2ec040f5e2610845a11c. I can add that to Tools perma

[issue43684] Add combined opcodes

2021-04-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Interesting. What code did you use to collect statistics? I used patches in issue27255. Perhaps it is worth to add an optionally compiled code for collecting dynamic opcode statistics permanently. We have around 125 opcodes, so 0.5% looks too small. But wh

[issue43684] Add combined opcodes

2021-04-06 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue43684] Add combined opcodes

2021-04-05 Thread Guido van Rossum
Guido van Rossum added the comment: So dynamically, I see about 0.5% of all opcodes are ADD_INT, so higher than statically (which was 0.1%) but still small enough that I'm abandoning work on ADD_INT. I've got a branch where I'm adding POP_JUMP_IF_NONE and POP_JUMP_IF_NOT_NONE (which capture

[issue43684] Add combined opcodes

2021-04-02 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue43684] Add combined opcodes

2021-04-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Statically, in the stdlib, about 1 in a 1000 opcodes > is an ADD_INT candidate. I would expect that ADD_INT would typically occur in loops, so even if it is a rare opcode statically, it will really count when it used. -- nosy: +rhettinger

[issue43684] Add combined opcodes

2021-04-02 Thread Guido van Rossum
Guido van Rossum added the comment: Statically, in the stdlib, about 1 in a 1000 opcodes is an ADD_INT candidate. I'll have to do some more work to come up with a dynamic count. -- ___ Python tracker __

[issue43684] Add combined opcodes

2021-04-02 Thread Tim Peters
Tim Peters added the comment: """ My philosophy here (which I learned from Tim Peters in the early 2000s) is that even though each individual improvement has no measurable effect on a general benchmark (as shown in the same comment), the combined effect of a number of tiny improvements can be

[issue43684] Add combined opcodes

2021-04-02 Thread Guido van Rossum
Guido van Rossum added the comment: Microbench results for ADD_INT: https://github.com/python/cpython/pull/25090#issuecomment-810441738 I have a few others like this lined up -- Mark recommended submitting them one at a time to make review easier. My philosophy here (which I learned from Tim

[issue43684] Add combined opcodes

2021-04-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We usually rejected such propositions unless there were evidences of significant effect on performance. I myself withdrawn several my patches after analyzing statistics. What percent of opcodes will be ADD_INT in the compiled bytecode? What percent of exe

[issue43684] Add combined opcodes

2021-04-01 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue43684] Add combined opcodes

2021-03-31 Thread Guido van Rossum
Change by Guido van Rossum : -- keywords: +patch pull_requests: +23868 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25090 ___ Python tracker ___

[issue43684] Add combined opcodes

2021-03-31 Thread Guido van Rossum
New submission from Guido van Rossum : I'm lining up some PRs (inspired by some of Mark Shannon's ideas) that add new opcodes which are straightforward combinations of existing opcodes. For example, ADD_INT is equivalent to LOAD_CONST + BINARY_ADD, for certain small (common) integer constants