Skip to content

Faster bypass re cache when DEBUG is passed #66700

Description

@serhiy-storchaka
BPO 22510
Nosy @pitrou, @ezio-melotti, @serhiy-storchaka
Files
  • re_debug_cache_faster.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 2014-09-29.17:02:10.439>
    created_at = <Date 2014-09-28.13:43:11.638>
    labels = ['expert-regex', 'type-feature', 'library']
    title = 'Faster bypass re cache when DEBUG is passed'
    updated_at = <Date 2014-09-29.17:02:10.438>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2014-09-29.17:02:10.438>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-09-29.17:02:10.439>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Regular Expressions']
    creation = <Date 2014-09-28.13:43:11.638>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['36749']
    hgrepos = []
    issue_num = 22510
    keywords = ['patch']
    message_count = 3.0
    messages = ['227758', '227801', '227810']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'ezio.melotti', 'mrabarnett', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22510'
    versions = ['Python 3.5']

    Activity

    1. serhiy-storchaka commented on Sep 28, 2014

      @serhiy-storchaka
      MemberAuthor

      Here is a patch which gets rid of small performance regression introduced by bpo-20426 patch. No need to check flags before cache lookup because patterns with the DEBUG flag are newer cached.

      $ ./python -m timeit -s "import re" -- "re.match('', '')"

      Before patch: 9.08 usec per loop
      After patch: 8 usec per loop

    2. python-dev commented on Sep 29, 2014

      python-devmannequin
      Mannequin

      New changeset 565096a32ce4 by Serhiy Storchaka in branch 'default':
      Issue bpo-22510: Get rid of little overhead of testing re.DEBUG flag.
      https://hg.python.org/cpython/rev/565096a32ce4

    3. serhiy-storchaka commented on Sep 29, 2014

      @serhiy-storchaka
      MemberAuthor

      Thank you Antoine for your review.

    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

      stdlibStandard Library Python modules in the Lib/ directorytopic-regextype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions