Issue 22030: Use calloc in set resizing - Python tracker

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
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: vstinner Nosy List: rhettinger, vstinner
Priority: normal Keywords: patch

Created on 2014-07-22 07:32 by rhettinger, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
set_calloc.diff rhettinger, 2014-07-22 07:32 Apply calloc to set resizes review
Messages (3)
msg223638 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-07-22 07:32
Victor, how does this look?
msg223640 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-22 07:42
Be careful. In my tests, calloc() was slower than malloc() + memset() for
memory blocks smaller than 1 MB. Calloc() can be interesting if only a few
pages (4096 bytes) are modified.

You must provide benchmarks.
msg223641 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-22 07:49
See also issue #21644 (bytearray).