[std.database]

simendsjo simendsjo at gmail.com
Mon Oct 17 09:08:21 PDT 2011


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.


More information about the Digitalmars-d mailing list