Skip to content

Speed up pickling simple non-recusive values #78322

Closed

Description

@serhiy-storchaka
BPO 34141
Nosy @pitrou, @avassalotti, @serhiy-storchaka
PRs
  • bpo-34141: Optimized pickling simple non-recursive values. #8318
  • 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 = None
    closed_at = <Date 2018-07-18.07:20:57.114>
    created_at = <Date 2018-07-17.16:49:06.639>
    labels = ['3.8', 'library', 'performance']
    title = 'Speed up pickling simple non-recusive values'
    updated_at = <Date 2018-07-18.07:20:57.113>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-07-18.07:20:57.113>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-18.07:20:57.114>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2018-07-17.16:49:06.639>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34141
    keywords = ['patch']
    message_count = 2.0
    messages = ['321841', '321862']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'alexandre.vassalotti', 'serhiy.storchaka']
    pr_nums = ['8318']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue34141'
    versions = ['Python 3.8']

    Activity

    1. serhiy-storchaka commented on Jul 17, 2018

      @serhiy-storchaka
      MemberAuthor

      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

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      performancePerformance or resource usage
      on Jul 17, 2018
    3. serhiy-storchaka commented on Jul 18, 2018

      @serhiy-storchaka
      MemberAuthor

      New changeset 5d4cb54 by Serhiy Storchaka in branch 'master':
      bpo-34141: Optimized pickling simple non-recursive values. (GH-8318)
      5d4cb54

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifeperformancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions