On 17.10.2011 18:16, Piotr Szturmaj wrote:
simendsjo wrote:
On 17.10.2011 17:55, Piotr Szturmaj wrote:
simendsjo wrote:
On 17.10.2011 17:26, Piotr Szturmaj wrote:

You probably meant me. If we create MySQL client without using C
bindings then we would have one of the fastest bindings at all. It may
attract some people who write web apps to D. The same applies to
PostgreSQL for which I wrote client without using a C binding.

Why would a reimplementation be much faster? Is the C library
"slow"? Or
is there any overhead I'm not thinking of?

There is always a function call overhead and also most of the fields are
returned as strings, whereas in underlying protocol they are encoded
binary, i.e. int is not sent as its decimal string representation but as
4 bytes. This saves some time taken by string to int conversion
(parsing).

I see. I've looked a bit at the C library, and it seems the protocol
isn't very stable. Trying to support older MySQL versions and keep up
with protocol changes might be (too) tedious.

PostgreSQL's protocol is stable since 2003, but MySQL's is not very
friendly indeed. Phobos might follow opportunistic path and support
direct access with recent MySQL versions and C wrapper for older ones.

Since 2003? That's pretty impressive!
About MySql: The reason D is missing a lot of wrappers and libraries is the lack of manpower. This "duplicated" effort sounds like too much job at the current time. I think more people will flock to D once modules such as database and web-programming exists, and then more focus can go into optimizing.

Reply via email to