Thursday, 9 May 2013

Comparing python/mysql drivers

I made a small script to compare MySQLdb, OurSQL, mysql.connector and PyMysql.
[Edit] Add pypy 2.0 + pymysql

Here is the result

Simple Select 1 record 10000x

  • 1.33500003815 MySQLdb
  • 2.92000007629 oursql
  • 4.75300002098 mysql.connector
  • 6.37299990654 pymysql
  • 3.05999994278 pypy + pymysql

Select * 500 rows 1000x

  • 5.27799987793 MySQLdb
  • 4.88400006294 oursql
  • 35.1779999733 mysql.connector
  • 45.4629998207 pymysql
  • 6.82800006866 pypy + pymysql 

Select 500 rows with 500 args 1000x

  • 2.97600007057 MySQLdb
  • 3.20799994469 oursql
  • 4.76099991798 mysql.connector
  • 4.15899991989 pymysql
  • 2.95799994469 pypy + pymysql 

Select 300k id 5x

  • 1.84399986267 MySQLdb
  • 1.62400007248 oursql
  • 24.6400001049 mysql.connector
  • 35.6339998245 pymysql
  • 4.90300011635 pypy + pymysql 

Simple Select 1M3 id 1x

  • 16.1340000629 MySQLdb
  • 70.8839998245 oursql
  • 247.088000059 mysql.connector
  • 339.72300005 pymysql
  • 44.5699999332 pypy + pymysql 
The script can be found here:https://github.com/Benoss/PythonMysqlDriversTest

No comments:

Post a comment