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

improve performance of binascii.a2b_base64() #78930

Closed
sir-sigurd mannequin opened this issue Sep 20, 2018 · 2 comments
Closed

improve performance of binascii.a2b_base64() #78930

sir-sigurd mannequin opened this issue Sep 20, 2018 · 2 comments
Labels
3.8 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage

Comments

@sir-sigurd
Copy link
Mannequin

sir-sigurd mannequin commented Sep 20, 2018

BPO 34749
Nosy @sir-sigurd, @miss-islington
PRs
  • bpo-34749: Improved performance of binascii.a2b_base64(). #9444
  • 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 2019-07-15.00:14:13.707>
    created_at = <Date 2018-09-20.11:45:10.952>
    labels = ['extension-modules', '3.8', 'performance']
    title = 'improve performance of binascii.a2b_base64()'
    updated_at = <Date 2019-07-15.00:14:13.707>
    user = 'https://github.com/sir-sigurd'

    bugs.python.org fields:

    activity = <Date 2019-07-15.00:14:13.707>
    actor = 'petr.viktorin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-15.00:14:13.707>
    closer = 'petr.viktorin'
    components = ['Extension Modules']
    creation = <Date 2018-09-20.11:45:10.952>
    creator = 'sir-sigurd'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34749
    keywords = ['patch']
    message_count = 2.0
    messages = ['325860', '347907']
    nosy_count = 2.0
    nosy_names = ['sir-sigurd', 'miss-islington']
    pr_nums = ['9444']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue34749'
    versions = ['Python 3.8']

    @sir-sigurd
    Copy link
    Mannequin Author

    sir-sigurd mannequin commented Sep 20, 2018

    I reworked implementation of binascii.a2b_base64() and there is significant speedup:

    $ python -m perf timeit --compare-to ~/tmp/cpython-master-venv/bin/python -s "from binascii import b2a_base64, a2b_base64; s = b2a_base64(1000 * b'b')" "a2b_base64(s)"
    /home/sergey/tmp/cpython-master-venv/bin/python: ..................... 3.43 us +- 0.01 us
    /home/sergey/tmp/cpython-dev-venv/bin/python: ..................... 1.52 us +- 0.01 us
    Mean +- std dev: [/home/sergey/tmp/cpython-master-venv/bin/python] 3.43 us +- 0.01 us -> [/home/sergey/tmp/cpython-dev-venv/bin/python] 1.52 us +- 0.01 us: 2.26x faster (-56%)
    
    $ python -m perf timeit --compare-to ~/tmp/cpython-master-venv/bin/python -s "from binascii import b2a_base64, a2b_base64; s = b2a_base64(1 * b'b')" "a2b_base64(s)"
    /home/sergey/tmp/cpython-master-venv/bin/python: ..................... 76.0 ns +- 0.2 ns
    /home/sergey/tmp/cpython-dev-venv/bin/python: ..................... 69.2 ns +- 0.1 ns
    Mean +- std dev: [/home/sergey/tmp/cpython-master-venv/bin/python] 76.0 ns +- 0.2 ns -> [/home/sergey/tmp/cpython-dev-venv/bin/python] 69.2 ns +- 0.1 ns: 1.10x faster (-9%)

    @sir-sigurd sir-sigurd mannequin added 3.8 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage labels Sep 20, 2018
    @miss-islington
    Copy link
    Contributor

    New changeset 1c5e68e by Miss Islington (bot) (Sergey Fedoseev) in branch 'master':
    bpo-34749: Improved performance of binascii.a2b_base64(). (GH-9444)
    1c5e68e

    @encukou encukou closed this as completed Jul 15, 2019
    @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
    3.8 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants