-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
pg performance v node-mysql-libmysqlsclient #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My create table script had a typo and it was using the MyISAM storage engine. After fixing, there is about a 15% difference: ITERATIONS 50000
pg 18236
testLibMysql 15409 |
yeah it's hard to tell with benchmarks where the problem is. It's exceptionally hard with native bindings because the boundary between what happens in C and what happens in JavaScript has a (semi)unpredictable impact on performance. Basically the act of turning a C string/whatever into a JavaScript object is a non trivial act and can influence the v8 runtime's performance. The trickiest part is tuning things for today's v8 implementation (which I cannot do since v8's internals are way over my head) could in fact turn out to be all for naught when they change the VM in the future. tl;dr: premature optimization is the root of all evil. It's good to see the difference between pg & mysql is low though. |
* Prevent double release with callback When using the callback instead of client.release, double releasing a client was possible causing clients to be re-added multiple times. * Remove idleListener when client is in-use When a client is in-use, the error handling should be done by the consumer and not by the pool itself as this otherwise might cause errors to be handled multiple times. * Handle verify failures
I benchmarked pg native vs node-mysql-libmysqlclient on my MBP with 16GB Ram, SSD. I created a simple test alternating between insert and select for 50,000 iterations. I'm using default postgresql and mysql install from Homebrew. The Mysql table is using InnoDB engine. pg is more than 3x slower. Results are in milliseconds
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: