From fcbf7c97914e282ae031c0d341c8be7d99bcb13b Mon Sep 17 00:00:00 2001 From: kylev Date: Mon, 18 May 2009 22:30:19 +0000 Subject: [PATCH] "import" creates GIL overhead every time it is run. For threaded MySQLdb apps, it doesn't make sense to pay that cost for every execute(), so lets move some of these imports. http://wiki.python.org/moin/PythonSpeed/PerformanceTips#ImportStatementOverhead --- MySQLdb/MySQLdb/cursors.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/MySQLdb/MySQLdb/cursors.py b/MySQLdb/MySQLdb/cursors.py index 95d98c1..d38cd70 100644 --- a/MySQLdb/MySQLdb/cursors.py +++ b/MySQLdb/MySQLdb/cursors.py @@ -6,6 +6,9 @@ default, MySQLdb uses the Cursor class. """ import re +import sys +from types import ListType, TupleType, UnicodeType + restr = (r"\svalues\s*" r"(\(((?