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

multiprocessing: micro-optimize Connection.send_bytes() method #91355

Closed
animalize mannequin opened this issue Apr 2, 2022 · 1 comment
Closed

multiprocessing: micro-optimize Connection.send_bytes() method #91355

animalize mannequin opened this issue Apr 2, 2022 · 1 comment
Labels
3.11 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@animalize
Copy link
Mannequin

animalize mannequin commented Apr 2, 2022

BPO 47199
Nosy @animalize
PRs
  • bpo-47199: multiprocessing: micro-optimize Connection.send_bytes() method #32247
  • 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 = None
    created_at = <Date 2022-04-02.06:28:23.157>
    labels = ['3.11', 'library', 'performance']
    title = 'multiprocessing: micro-optimize Connection.send_bytes() method'
    updated_at = <Date 2022-04-02.06:29:49.762>
    user = 'https://github.com/animalize'

    bugs.python.org fields:

    activity = <Date 2022-04-02.06:29:49.762>
    actor = 'malin'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2022-04-02.06:28:23.157>
    creator = 'malin'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47199
    keywords = ['patch']
    message_count = 1.0
    messages = ['416538']
    nosy_count = 1.0
    nosy_names = ['malin']
    pr_nums = ['32247']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue47199'
    versions = ['Python 3.11']

    @animalize
    Copy link
    Mannequin Author

    animalize mannequin commented Apr 2, 2022

    bytes(m) can be replaced by memoryview.cast('B'), then no need for data copying.

            m = memoryview(buf)
            # HACK for byte-indexing of non-bytewise buffers (e.g. array.array)
            if m.itemsize > 1:
                m = memoryview(bytes(m))
            n = len(m)

    https://github.com/python/cpython/blob/v3.11.0a6/Lib/multiprocessing/connection.py#L190-L194

    @animalize animalize mannequin added 3.11 only security fixes stdlib Python modules in the Lib dir performance Performance or resource usage labels Apr 2, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @corona10 corona10 closed this as completed May 3, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant