
On 20/10/2020 5:48 pm, Chris Angelico wrote:
On Wed, Oct 21, 2020 at 3:31 AM Mark Shannon <mark@hotpy.org> wrote:
Hi Chris,
On 20/10/2020 4:37 pm, Chris Angelico wrote:
On Wed, Oct 21, 2020 at 12:03 AM Mark Shannon <mark@hotpy.org> wrote:
Hi everyone,
CPython is slow. We all know that, yet little is done to fix it.
I'd like to change that. I have a plan to speed up CPython by a factor of five over the next few years. But it needs funding.
The overall aim is to speed up CPython by a factor of (approximately) five. We aim to do this in four distinct stages, each stage increasing the speed of CPython by (approximately) 50%.
This is a very bold estimate. Particularly, you're proposing a number of small tweaks in stage 2 and expecting that (combined) they can give a 50% improvement in overall performance?
20 tweaks each providing a 2% is a 49% speedup. Stage 1 will open up optimizations that are currently worthwhile.
Yes, I understand mathematics. Do you have evidence that shows that each of the twenty tweaks can give a two percent speedup though?
My point was that small changes can easily add up to a large change. And yes, I have a long list of possible small optimizations.
Do you have any details to back this up? You're not just asking for a proposal to be accepted, you're actually asking for (quite a bit of) money, and then hoping to find a contractor to do the actual work.
I am offering to do the work.
Sure, that takes away some of the uncertainty, but you're still asking for a considerable amount of money sight-unseen.
I'm not asking for money up front. I'm asking for some promise of payment, once the work is done. If I fail, only I suffer a loss.
BIG BIG concern: You're basically assuming that all this definition of performance is measured for repeated executions of code. That's how PyPy already works, and it most often suffers quite badly in startup performance to make this happen. Will your proposed changes mean that CPython has to pay the same startup costs that PyPy does?
Could you clarify what you think I'm assuming?
When you say start up, do you mean this?
$ time python3 -S -c ""
real 0m0.010s
$ time pypy -S -c ""
real 0m0.017s
No, there would be no slower startup. In fact the tier 0 interpreter should start a fraction faster than 3.9.
That's a microbenchmark, but yes, that's the kind of thing I'm talking about. For short scripts, will "python3.13 script.py" be slower than "python3.9 script.py"?
Tiered execution means that 3.10+ should be no slower than 3.9 for any program, and faster for all but really short ones. Tier 0 would be a bit slower than 3.9, but will start faster. Tier 1 should kick in before 3.9 would catch up. Cheers, Mark.