[openstack-dev] [oslo.db] PyMySQL review

Yuriy Taraday yorik.sar at gmail.com
Mon Feb 2 11:37:25 UTC 2015


On Mon Feb 02 2015 at 11:49:31 AM Julien Danjou <julien at danjou.info> wrote:

> On Fri, Jan 30 2015, Yuriy Taraday wrote:
>
> > That's a great research! Under its impression I've spent most of last
> > evening reading PyMySQL sources. It looks like it not as much need C
> > speedups currently as plain old Python optimizations. Protocol parsing
> code
> > seems very inefficient (chained struct.unpack's interleaved with data
> > copying and util method calls that do the same struct.unpack with
> > unnecessary type check... wow...) That's a huge place for improvement.
> > I think it worth spending time on coming vacation to fix these slowdowns.
> > We'll see if they'll pay back those 10% slowdown people are talking
> about.
>
> With all my respect, you may be right, but I need to say it'd be better
> to profile and then optimize rather than spend time rewriting random
> parts of the code then hoping it's going to be faster. :-)
>

Don't worry, I do profile. Currently I use mini-benchmark Mike provided an
optimizing hottest methods. I'm already getting 25% more speed in this case
and that's not a limit. I will be posting pull requests to pymysql soon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150202/04ef2b73/attachment.html>


More information about the OpenStack-dev mailing list