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.

Author serhiy.storchaka
Recipients alexandre.vassalotti, pitrou, serhiy.storchaka
Date 2018-07-17.16:49:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The proposed PR reduces an overhead of calling Py_EnterRecursiveCall() when pickle simple non-recusive values: None, True, False, instances of int, float, bytes, str.

$ ./python -m timeit -s 'data = list(range(10**7)); import pickle' -- 'pickle.dumps(data)'

Unpatched:  218 msec per loop
Patched:    147 msec per loop

$ ./python -m timeit -s 'data = list(map(float, range(10**7))); import pickle' -- 'pickle.dumps(data)'

Unpatched:  218 msec per loop
Patched:    179 msec per loop

$ ./python -m timeit -s 'data = list(map(str, range(10**6))); import pickle' -- 'pickle.dumps(data)'

Unpatched:  212 msec per loop
Patched:    201 msec per loop
Date User Action Args
2018-07-17 16:49:06serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, alexandre.vassalotti
2018-07-17 16:49:06serhiy.storchakasetmessageid: <>
2018-07-17 16:49:06serhiy.storchakalinkissue34141 messages
2018-07-17 16:49:06serhiy.storchakacreate