performance comparision: mysql python (C API based) vs. mysql connector/python (implemented in python)

Asked by tormen

Hi,

I wonder about the performance of mysql connector/python in comparison with the C API based mysql python (http://mysql-python.sourceforge.net/)
... and I imagine that mysql connector/python must be (much) slower?
... but I didn't try it.

Any feedback would be highly appreciated!

tormen.

Question information

Language:
English Edit question
Status:
Solved
For:
MySQL Connector/Python Edit question
Assignee:
Geert JM Vanderkelen Edit question
Solved by:
Geert JM Vanderkelen
Solved:
Last query:
Last reply:
Revision history for this message
Geert JM Vanderkelen (geertjmvdk) said :
#1

MySQL Connector/Python is slower than the database interfaces using libmysqlclient. My first benchmarks showed that.
However, it's not SO a big difference and I really hope to make it as performant as possible. But same speed.. It might need a faster Python first.

Hope this helps. (Sorry for the late reply, totally missed the question on Launchpad for some reason..)

Revision history for this message
tormen (quickhelp) said :
#2

Thanks for your reply (yeah I was beginning to wonder ;).

Do you have maybe an idea of the order of magnitude for me?
Like 50% or 100% or 200% slower.

As most of the hard work will be done anyway for us within the mysql servers I guess (hope) python and mysql connector/python will be fast enough :)

But I agree ... and hope that python4 will aim for more speed (again).

Revision history for this message
Best Geert JM Vanderkelen (geertjmvdk) said :
#3

Well.. Half year ago I tried some very basic benchmarks, and it was like 50% slower. But I'm sure that this has improved since then.
We need some kind of benchmarking to test regressions in performance, so I'll see what I can do.

It would be good to check with your own benchmarks though. Just switching the database interfaces in your application might do the trick (at least in Python v2).

Revision history for this message
tormen (quickhelp) said :
#4

To keep at least an eye on performance sounds like a good idea.
Of course python is not C (speedwise), but still.
Even in python you can do things slow or fast (sometimes differing with a factor of 30).

Unfortunately I won't be able to benchmark myself as we just started. And only in python3.

I will be eager to hear more on this topic but for now your "I'll see what I can do." is good enough! :)

Revision history for this message
tormen (quickhelp) said :
#5

Thanks Geert JM Vanderkelen, that solved my question.