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

Compute allocated blocks in _Py_GetAllocatedBlocks() #81718

Closed
nascheme opened this issue Jul 10, 2019 · 4 comments
Closed

Compute allocated blocks in _Py_GetAllocatedBlocks() #81718

nascheme opened this issue Jul 10, 2019 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@nascheme
Copy link
Member

BPO 37537
Nosy @tim-one, @nascheme, @isidentical
PRs
  • bpo-37537: Compute allocated blocks in _Py_GetAllocatedBlocks() #14680
  • 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 2020-01-07.07:41:59.791>
    created_at = <Date 2019-07-10.06:27:59.653>
    labels = ['interpreter-core']
    title = 'Compute allocated blocks in _Py_GetAllocatedBlocks()'
    updated_at = <Date 2020-01-07.07:41:59.790>
    user = 'https://github.com/nascheme'

    bugs.python.org fields:

    activity = <Date 2020-01-07.07:41:59.790>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-07.07:41:59.791>
    closer = 'methane'
    components = ['Interpreter Core']
    creation = <Date 2019-07-10.06:27:59.653>
    creator = 'nascheme'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37537
    keywords = ['patch']
    message_count = 4.0
    messages = ['347602', '347603', '347635', '359492']
    nosy_count = 3.0
    nosy_names = ['tim.peters', 'nascheme', 'BTaskaya']
    pr_nums = ['14680']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37537'
    versions = []

    @nascheme
    Copy link
    Member Author

    This is a small but measurable optimization for _PyObject_Malloc and _PyObject_Free. It slows down _Py_GetAllocatedBlocks a bit but I think that's a price worth paying.

    @nascheme nascheme added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jul 10, 2019
    @nascheme
    Copy link
    Member Author

    PyPerformance result, using --enable-optimizations

    +-------------------------+---------+------------------------------+
    | Benchmark | base | no-allocated |
    +=========================+=========+==============================+
    | 2to3 | 388 ms | 385 ms: 1.01x faster (-1%) |
    +-------------------------+---------+------------------------------+
    | dulwich_log | 91.8 ms | 92.8 ms: 1.01x slower (+1%) |
    +-------------------------+---------+------------------------------+
    | go | 302 ms | 296 ms: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | hexiom | 11.4 ms | 11.5 ms: 1.01x slower (+1%) |
    +-------------------------+---------+------------------------------+
    | json_dumps | 14.0 ms | 13.7 ms: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | logging_format | 12.1 us | 11.9 us: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | logging_simple | 10.9 us | 10.6 us: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | pickle_dict | 23.6 us | 21.3 us: 1.11x faster (-10%) |
    +-------------------------+---------+------------------------------+
    | pidigits | 208 ms | 210 ms: 1.01x slower (+1%) |
    +-------------------------+---------+------------------------------+
    | python_startup | 9.73 ms | 9.66 ms: 1.01x faster (-1%) |
    +-------------------------+---------+------------------------------+
    | python_startup_no_site | 6.70 ms | 6.66 ms: 1.01x faster (-1%) |
    +-------------------------+---------+------------------------------+
    | regex_dna | 199 ms | 195 ms: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | regex_effbot | 3.18 ms | 3.14 ms: 1.01x faster (-1%) |
    +-------------------------+---------+------------------------------+
    | regex_v8 | 25.0 ms | 24.4 ms: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | scimark_fft | 421 ms | 426 ms: 1.01x slower (+1%) |
    +-------------------------+---------+------------------------------+
    | scimark_sor | 220 ms | 223 ms: 1.01x slower (+1%) |
    +-------------------------+---------+------------------------------+
    | scimark_sparse_mat_mult | 5.18 ms | 5.33 ms: 1.03x slower (+3%) |
    +-------------------------+---------+------------------------------+
    | spectral_norm | 159 ms | 156 ms: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | unpickle | 14.6 us | 14.2 us: 1.02x faster (-2%) |
    +-------------------------+---------+------------------------------+
    | unpickle_list | 4.46 us | 4.33 us: 1.03x faster (-3%) |
    +-------------------------+---------+------------------------------+
    | xml_etree_iterparse | 141 ms | 139 ms: 1.01x faster (-1%) |
    +-------------------------+---------+------------------------------+

    Not significant (36): chaos; crypto_pyaes; deltablue; django_template; fannkuch; float; html5lib; json_loads; logging_silent; mako; meteor_contest; nbody; nqueens; pathlib; pickle; pickle_list; pickle_pure_python; raytrace; regex_compile; richards; scimark_lu; scimark_monte_carlo; sqlalchemy_declarative; sqlalchemy_imperative; sqlite_synth; sympy_expand; sympy_integrate; sympy_sum; sympy_str; telco; tornado_http; unpack_sequence; unpickle_pure_python; xml_etree_parse; xml_etree_generate; xml_etree_process

    @nascheme
    Copy link
    Member Author

    New changeset 5d25f2b by Neil Schemenauer in branch 'master':
    bpo-37537: Compute allocated blocks in _Py_GetAllocatedBlocks() (bpo-14680)
    5d25f2b

    @isidentical
    Copy link
    Sponsor Member

    Anything left on this issue, PR 14680 looks resolved this issue.

    @methane methane closed this as completed Jan 7, 2020
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants