You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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? :(
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.
Activity
zcattacz commentedon Dec 2, 2016
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.
groutr commentedon Jan 19, 2017
What is the status of this speedup module?
byaka commentedon Jun 20, 2017
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? :(
groutr commentedon Jan 16, 2018
I'm willing to make an initial attempt at isolating and simplifying the parsing code (issue 2 from above).
rspadim commentedon Jun 22, 2020
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
rspadim commentedon Jun 22, 2020
and maybe we could use numba+cython, when possible?
kesmit13 commentedon Sep 6, 2022
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.