[std.database]

Piotr Szturmaj bncrbme at jadamspam.pl
Mon Oct 17 09:16:42 PDT 2011


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.


More information about the Digitalmars-d mailing list