cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: DNS cache size control

From: Jacky Lam <sylam_at_emsoftltd.com>
Date: Mon, 22 Apr 2002 18:09:02 +0800

>
> Just a question (in which I haven't investigated much myself): you chose to
> decrease the size of the previous malloc() using a realloc() after the
> resolve is done, instead of using realloc() multiple times to enlarge the
> buffer.
>
> While this is certainly a faster operation than enlarging the buffer would
> be, is it as effective? I mean memory-wise. Real-world malloc
> implementations taken into account.

        Actually, I have both version...But I think that the patch I sent should be
faster in terms of number of syscalls while the overhead of realloc in both
case should be more or less the same.

        Through I am not sure, the difference between two different ways should be
small and the speed overhead of this part is not so important to the overall
performance of libcurl. Do you think so?

Jacky
Received on 2002-04-22