| Arevos |
Aug 25th, 2006 11:43 AM |
Quote:
Originally Posted by Sane
I've heard there is PySQL, is that any different than MySQL with Python? What is the performance drop when using MySQL with Python, as opposed to MySQL with PHP?
|
Generally speaking, MySQLdb is the defacto MySQL module for Python. It uses the MySQL library bindings (programmed in C), so it's about as fast as is possible to get. It is also fully compliant with the Python Database API Specification, which is the standard way to interface with SQL databases from Python.
In terms of performance, Python should outperform PHP, given the same platform (i.e. if you're using mod_php under Apache, a fair test would use mod_python), as PHP is interpreted (IIRC), and Python is internally compiled into bytecode before execution, which, in general, tends to operate somewhat faster than a straight AST.
That said, I'd imagine all the PHP MySQL library is codedentirely in C or C++, whilst the Python library is partially coded in Python. I'd imagine the difference between them would be small, but it would be interesting to run some speed tests.
Quote:
Originally Posted by Sane
And finally, is there a way to embed your MySQL database and client in to the Python Py2exe Executable, so a user does not need to install a separate MySQL client program in order to use your Python Application?
|
Presumably. I can include OpenGL, SDL, GTK and wxWidgets libraries in a Py2exe excutable. MySQL should be no different.
|