cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-118830: Bump DEFAULT_PROTOCOL to 5 (#118830)

Open mdkcore0 opened this issue 1 year ago • 12 comments
trafficstars

I didn't have add a news entry, as it is not a user facing change. Should do I add it?

  • Issue: gh-118830

📚 Documentation preview 📚: https://cpython-previews--119340.org.readthedocs.build/

mdkcore0 avatar May 21 '24 18:05 mdkcore0

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

bedevere-app[bot] avatar May 21 '24 18:05 bedevere-app[bot]

On a second thought it makes sense to add it, but in which section this change falls in?

mdkcore0 avatar May 21 '24 18:05 mdkcore0

Yes, this deserves a NEWS entry, and it should go in Library section, I think.

carljm avatar May 21 '24 19:05 carljm

This not only deserves a change log entry but also a "What's New in Python 3.14" entry.

ambv avatar May 21 '24 19:05 ambv

@carljm, @ambv: I've added requested entries

For the "WhatsNew in 3.14" I looked on how it was added for python 3.8 (the rst file), it includes some wording about the impact on performance (under Optimizations section):

  • The default protocol in the :mod:pickle module is now Protocol 4, first introduced in Python 3.4. It offers better performance and smaller size compared to Protocol 3 available since Python 3.0.

Is it a good idea to add something like that here? Since I'm starting contributing now, I will need some help to fulfill it :)

mdkcore0 avatar May 22 '24 02:05 mdkcore0

Before bumping it to version 5, I would like to address #120380 since it could introduce breakage. At least, there was something that was not correctly handled for pickle's buffers.

picnixz avatar Jun 13 '24 08:06 picnixz

Before bumping it to version 5, I would like to address #120380 since it could introduce breakage. At least, there was something that was not correctly handled for pickle's buffers.

no problem, thanks!!

mdkcore0 avatar Jun 18 '24 03:06 mdkcore0

Now that https://github.com/python/cpython/issues/120380 is fixed, I think this can be done, unless someone finds something that is broken for protocol 5 or something that should be supported for protocol 5 and that is not. There are https://github.com/python/cpython/issues/84895 and https://github.com/python/cpython/issues/89467 which could be something that is desired before bumping the default protocol to protocol 5 since they could dramatically improve performances (especially the second one).

picnixz avatar Jun 27 '24 09:06 picnixz

I don't think either of those needs to block this PR.

I've resolved the conflict in the What's New document, and in the process moved the entry from Optimizations to Improved Modules. Unlike version 4, version 5 isn't primarily a performance improvement.

encukou avatar Jul 03 '24 13:07 encukou

See also the failed CI check:

Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen. ;)

hugovk avatar Jul 03 '24 14:07 hugovk

See also the failed CI check:

Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen. ;)

oh, cool I run the mentioned command, should I commit the modified files them (Modules/_pickle.c and Modules/clinic/_pickle.c.h)?

mdkcore0 avatar Jul 03 '24 14:07 mdkcore0

Yes please!

hugovk avatar Jul 03 '24 14:07 hugovk

Thank you!

encukou avatar Jul 19 '24 14:07 encukou