Skip to content

Add speedup module for CPython #297

Open

Description

@methane

There are two bottlenecks.

  1. Reading packet
  2. Parsing packet

1 is resolved by using io module.

To resolve issue 2, we should remove classes for parsing packets, and use simple flat function and
builtin types. It make PyMySQL on PyPy faster.
Then, we can easily replace them with speedup module written in C.

Activity

  1. added this to the 0.7 milestone on Feb 2, 2015
  2. removed this from the 0.7 milestone on May 17, 2016
  3. modified the milestones: 0.7, 0.8 on Jul 14, 2016
  4. modified the milestones: , on Aug 30, 2016
  5. zcattacz commented on Dec 2, 2016

    @zcattacz

    I have script periodically pump excel data into mariadb using pymysql.
    each time it needs to send ~50k records. it takes about 5.5 min.
    After compiling pymysql module with Nuitka, the time is lowered to 3.2min.
    I consider it a good speed gain.

  6. groutr commented on Jan 19, 2017

    @groutr

    What is the status of this speedup module?

  7. byaka commented on Jun 20, 2017

    @byaka

    micro-optimisations, that converts source from hierarchical to linear really can burst performance near 20% in some cases, but it bad way. much better to rewrite thats parts of code to cython...
    anyway i agree with TS, but who has time for full rewrite of parser? :(

  8. groutr commented on Jan 16, 2018

    @groutr

    I'm willing to make an initial attempt at isolating and simplifying the parsing code (issue 2 from above).

  9. rspadim commented on Jun 22, 2020

    @rspadim

    i was using aiomysql, and found a point to speed up

    when i was executing a insert ignore, or something that could report a known warning, it was executing a show warnings (2 queries)

    force removing the show warnings changed my app to run from ~7kqps to ~10kqps (multi process)

    i didn't checked pymysql code, but this could be a nice parameter at cursor.execute() function

  10. rspadim commented on Jun 22, 2020

    @rspadim

    and maybe we could use numba+cython, when possible?

  11. kesmit13 commented on Sep 6, 2022

    @kesmit13

    I opened another similar issue (#1066) not realizing this one was here. I have a fork of PyMySQL with a C extension that replaces the row data reader method and adds some tuned cursors that gives significant speed improvements. The issue was opened to start a conversation about a possible plugin for PyMySQL, and to collaborate on further improvements.

  12. removed this from the milestone on May 23, 2023
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions