This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Pickle performance regression in 3.10
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: alexandre.vassalotti, kj, pablogsal, rhettinger, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2021-04-19 15:12 by kj, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg391380 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-04-19 15:12
Hi everyone, I noticed on speed.python.org that the pickle benchmarks are noticeably slower:

Overall, pickle slowed down by >10%
https://speed.python.org/timeline/?exe=12&base=&ben=pickle&env=1&revs=200&equid=off&quarts=on&extr=on

Pickling list and dict is also slower by >10%:
https://speed.python.org/timeline/?exe=12&base=&ben=pickle_list&env=1&revs=200&equid=off&quarts=on&extr=on

https://speed.python.org/timeline/?exe=12&base=&ben=pickle_dict&env=1&revs=200&equid=off&quarts=on&extr=on

For some reason, the pickle_pure_python benchmark which doesn't use the _pickle C library has no change.

The regression happened somewhere between commit 11159d2c9d6616497ef4cc62953a5c3cc8454afb and 3fc65b97d09fd29272fdf60d2e567bfb070da824. I don't know which commit caused it as there doesn't seem to be a change to _pickle.c. I have a weak hunch that it may be linked to Issue38530 (since the other commits in that time range are docs, sqllite3, ssl and unrelated python libraries) but I'm unsure. I'll try to bisect things this weekend if nobody's started on it by then.

Thanks for your time!
msg391382 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-04-19 15:33
It definitely shouldn't be related to any of these, all are unrelated code paths.
msg391383 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-04-19 15:39
> It definitely shouldn't be related to any of these, all are unrelated code paths.

Yeah I thought so too :(. After looking at the benchmark code in pyperformance, I can't find anything related in the commits that would cause such a big difference. Hmmm...
msg391829 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-04-25 00:58
I'm unable to reproduce the regression locally with pyperformance. Additionally, the links on speed.python.org show that the results returned to normal after a week (again seemingly without any commit to cause such a change).

I'm closing this bug as it doesn't seem related to the code in cpython itself. Thanks everyone.

-----

$ pyperf compare_to 2021-04-13_23-59-master-11159d2c9d66.json.gz 2021-04-14_23-03-master-3fc65b97d09f.json.gz  
pickle_dict: Mean +- std dev: [2021-04-13_23-59-master-11159d2c9d66] 72.0 us +- 1.6 us -> [2021-04-14_23-03-master-3fc65b97d09f] 73.1 us +- 0.9 us: 1.02x slower
pickle_list: Mean +- std dev: [2021-04-13_23-59-master-11159d2c9d66] 11.1 us +- 0.1 us -> [2021-04-14_23-03-master-3fc65b97d09f] 11.0 us +- 0.1 us: 1.01x faster

Benchmark hidden because not significant (1): pickle

Geometric mean: 1.00x slower
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 88055
2021-04-25 00:58:54kjsetstatus: open -> closed
resolution: works for me
messages: + msg391829

stage: resolved
2021-04-19 15:44:08rhettingersetnosy: + rhettinger
2021-04-19 15:39:07kjsetmessages: + msg391383
2021-04-19 15:33:15pablogsalsetmessages: + msg391382
2021-04-19 15:12:15kjcreate