Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use calloc in set resizing #66229

Closed
rhettinger opened this issue Jul 22, 2014 · 3 comments
Closed

Use calloc in set resizing #66229

rhettinger opened this issue Jul 22, 2014 · 3 comments
Assignees
Labels
performance Performance or resource usage

Comments

@rhettinger
Copy link
Contributor

BPO 22030
Nosy @rhettinger, @vstinner
Files
  • set_calloc.diff: Apply calloc to set resizes
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/vstinner'
    closed_at = <Date 2014-07-22.08:06:02.206>
    created_at = <Date 2014-07-22.07:32:08.867>
    labels = ['performance']
    title = 'Use calloc in set resizing'
    updated_at = <Date 2014-07-22.08:06:02.205>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2014-07-22.08:06:02.205>
    actor = 'rhettinger'
    assignee = 'vstinner'
    closed = True
    closed_date = <Date 2014-07-22.08:06:02.206>
    closer = 'rhettinger'
    components = []
    creation = <Date 2014-07-22.07:32:08.867>
    creator = 'rhettinger'
    dependencies = []
    files = ['36024']
    hgrepos = []
    issue_num = 22030
    keywords = ['patch']
    message_count = 3.0
    messages = ['223638', '223640', '223641']
    nosy_count = 2.0
    nosy_names = ['rhettinger', 'vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue22030'
    versions = ['Python 3.5']

    @rhettinger
    Copy link
    Contributor Author

    Victor, how does this look?

    @rhettinger rhettinger added the performance Performance or resource usage label Jul 22, 2014
    @vstinner
    Copy link
    Member

    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.

    @vstinner
    Copy link
    Member

    See also issue bpo-21644 (bytearray).

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants