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

faster utf-8 decoding #57626

Closed
pitrou opened this issue Nov 16, 2011 · 4 comments
Closed

faster utf-8 decoding #57626

pitrou opened this issue Nov 16, 2011 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@pitrou
Copy link
Member

pitrou commented Nov 16, 2011

BPO 13417
Nosy @gpshead, @pitrou, @vstinner
Files
  • utf8lib2.patch
  • 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 2011-11-21.19:48:56.695>
    created_at = <Date 2011-11-16.22:49:41.308>
    labels = ['interpreter-core', 'performance']
    title = 'faster utf-8 decoding'
    updated_at = <Date 2011-11-21.19:48:56.693>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2011-11-21.19:48:56.693>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-11-21.19:48:56.695>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2011-11-16.22:49:41.308>
    creator = 'pitrou'
    dependencies = []
    files = ['23712']
    hgrepos = []
    issue_num = 13417
    keywords = ['patch']
    message_count = 4.0
    messages = ['147778', '147926', '148076', '148078']
    nosy_count = 4.0
    nosy_names = ['gregory.p.smith', 'pitrou', 'vstinner', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue13417'
    versions = ['Python 3.3']

    @pitrou
    Copy link
    Member Author

    pitrou commented Nov 16, 2011

    PEP-393 and the need for a two-pass decoding process has made utf-8 decoding much slower, especially with the current generic implementation. Attached patch makes utf-8 more than twice faster, which means we're around 10-20% slower than 3.2 on non-trivial cases.

    @pitrou pitrou added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Nov 16, 2011
    @gpshead
    Copy link
    Member

    gpshead commented Nov 19, 2011

    +1 nice! A couple minor comments on the code review.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 21, 2011

    New changeset 8e6c4acaf530 by Antoine Pitrou in branch 'default':
    Issue bpo-13417: speed up utf-8 decoding by around 2x for the non-fully-ASCII case.
    http://hg.python.org/cpython/rev/8e6c4acaf530

    @pitrou
    Copy link
    Member Author

    pitrou commented Nov 21, 2011

    Thanks for the review, patch committed now (with bogus comments removed).

    @pitrou pitrou closed this as completed Nov 21, 2011
    @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) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants