Skip to content

[sqlite3] speed up cursor.execute*() #90792

Description

@erlend-aasland
BPO 46634
Nosy @erlend-aasland
PRs
  • bpo-46634: Inline calls to Connection.cursor() in sqlite3 #31127
  • 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 2022-02-17.08:26:39.839>
    created_at = <Date 2022-02-04.10:38:53.668>
    labels = ['extension-modules', '3.11']
    title = '[sqlite3]\xc2\xa0speed up cursor.execute*()'
    updated_at = <Date 2022-02-17.08:26:39.838>
    user = 'https://github.com/erlend-aasland'

    bugs.python.org fields:

    activity = <Date 2022-02-17.08:26:39.838>
    actor = 'erlendaasland'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-17.08:26:39.839>
    closer = 'erlendaasland'
    components = ['Extension Modules']
    creation = <Date 2022-02-04.10:38:53.668>
    creator = 'erlendaasland'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46634
    keywords = ['patch']
    message_count = 2.0
    messages = ['412503', '413390']
    nosy_count = 1.0
    nosy_names = ['erlendaasland']
    pr_nums = ['31127']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46634'
    versions = ['Python 3.11']

    Activity

    1. erlend-aasland commented on Feb 4, 2022

      @erlend-aasland
      ContributorAuthor

      pysqlite_connection_execute_impl() and friends (executemany, executescript) goes all the way through the Call API just to call pysqlite_connection_cursor_impl. We can same a lot of calls by calling the cursor _impl function directly; after all, it does live in the same file scope as the callers.

      A quick bench (sqlitesynth) shows a small speedup:

      Mean +- std dev: [main] 9.55 us +- 0.25 us -> [patched] 9.32 us +- 0.23 us: 1.02x faster
      

      (Side effect: will get rid of _Py_IDENTIFIER(cursor) in sqlite3)

    2. erlend-aasland commented on Feb 17, 2022

      @erlend-aasland
      ContributorAuthor

      The change proposed in #75310 was included in #75532. Closing this.

    3. 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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions