MySQL binding using libmysqlclient

110 views
Skip to first unread message

Oleg "Sannis" Efimov

unread,
Apr 5, 2010, 7:06:18 PM4/5/10
to nodejs
Hello for all!

I am pleased to present you the first usable version of the node-mysql-
libmysqlclient:
http://github.com/Sannis/node-mysql-libmysqlclient/tree/v0.0.6

At present it is mostly synchronous library with the possibility of
rough asynchronous query execution. I will be glad to get community
help in the discussion around this library, I hope your advices will
help me to improve library interface and it will became usable in
production at an early date.

I'm not good at spoken English, so that's just my message is still
full of repeating words, let me quote part of README:
> Today this library supports all basic functions for working with MySQL.
> In the near future, I plan to expand the list of methods
> that can be invoked in an asynchronous NodeJS style.
> I also postponed the implementation of prepared statements.
>
> I will be happy to hear tips from the more experienced programmers.
> If you are interested in wide MySQL usage in NodeJS applications,
> leave your comments to the code.
> Unfortunately not all methods are covered by unit and functional tests,
> so I'll be glad to see your forks and commits in them :)

If you are interested in comparing the speed of work with other
libraries,
you can download the module and run the test from the ./benchmark/
dir.
My results on old P4, my binding vs PHP:
> efimovov@oleg-pcbenchmark(master)>./benchmark_node_vs_php.sh
> NodeJS synchronouse MySQL bindings benchmark:
> Connect and disconnect(100000): 24.84s
> Escape string(10000000): 24.57s
> Inserts(200000): 23.19s
> Selects(100, 10): 28.82s
> Finish.
> Full time: 101.61s
>
> PHP MySQL bindings benchmark:
> Connect and disconnect(100000): 33.9s
> Escape string(10000000): 39.5s
> Inserts(200000): 21.4s
> Selects(100, 10): 27.74s
> Finish.
> Full time: 123.62s

Comparison with pure js implementation from Yuichiro MASUI:
> efimovov@oleg-pc:node-mysql-libmysqlclient/tests(master)>./run-speedtest-sync.js
> **** 100000 insertions in 7.416s (13484.358144552318/s)
> **** 100000 rows in 0.917s (109051.25408942203/s)
> efimovov@oleg-pc:node-mysql-libmysqlclient/tests(master)>./run-speedtest-async.js
> **** 100000 insertions in 11.067s (9035.872413481522/s)
> **** 100000 rows in 0.324s (308641.97530864197/s)
> efimovov@oleg-pc:node-mysql/examples(master)>node ./speedtest.js
> **** 100000 insertions in 28.753s (3477.897958473898/s)
> **** 100000 rows in 5.783s (17292.06294310911/s)
I know about big statistical variance in selects time, so this
speedtest can show you main trends.

P.S. Thanks for NodeJS, Ryan!

Oleg "Sannis" Efimov

unread,
Apr 5, 2010, 7:12:16 PM4/5/10
to nodejs
Add to my Russian colleagues: I'm very lazy to write the announcement
in Russian.
Maybe in a couple of days or at beautiful 0.0.7 release :)
However, I can't deny writing about it.
Reply all
Reply to author
Forward
0 new messages