Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

The performance is worse than pyMysql? (no replies)

$
0
0
I used pyMysql before. Now, I tried to use connection pool, and found there was a native pool implementation in the official connector. But, I compared their performance, and found MySQL Connector/Python have worse performance. Generally, I execute a select SQL, pyMysql cost 30 ms, but MySQL Connector/Python cost 100 ms.
Do you know how to tunning it?

I use the below code to get connection and execute sql.
dbconfig = {
'user' : 'xxxx',
'password' : 'xxxx',
'host' : 'localhost',
'database' :'test_db',
'pool_name' : 'mypool',
'pool_size' : 5
}
mysql.connector.connect(**dbconfig)

cursor = conn.cursor()
cursor.execute(sql)
rows = cursor.fetchall()

Viewing all articles
Browse latest Browse all 384

Trending Articles