On Wed, Oct 21, 2020 at 3:31 AM Mark Shannon <m...@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 <m...@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?

> > 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.

> > 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"?

> > What would happen if $2M were spent on improving PyPy3 instead?
>
> The PSF loses $1M to spend on CPython maintenance, to start with.
>
> What would happen to PyPy? I have no idea.
>
> Partial success of speeding up CPython is very valuable.
> Partial success in getting PyPy to support C extensions well and perform
> well when it currently does, is much less valuable.
>
> CPython that is "only" 2 or 3 times faster is a major improvement, but a
> PyPy that supports 80% of the C extensions that it currently does not is
> still not a replacement for CPython.
>

True, but it does sound like you're pushing for the sorts of changes
that PyPy already has. Not sure whether your proposed changes would be
better done to PyPy or to CPython.

ChrisA
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/I4XKZNAZBLPWCRS5EQ4UY6DMV3LDMJPN/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to