cURL / Mailing Lists / curl-library / Single Mail


Re: FILE * => fd ?

From: Sterling Hughes <>
Date: Sat, 11 Aug 2001 03:49:25 -0400 (EDT)

On Fri, 10 Aug 2001, Andrew Francis wrote:

> On Fri, 10 Aug 2001, Sterling Hughes wrote:
> > On Fri, 10 Aug 2001, SM wrote:
> >
> > > At 22:04 09-08-2001 +0800, Andrew Francis wrote:
> > > >Win32 has it's own native file routines - CreateFile, WriteFile, etc.. the
> > > >stdio functions are just implemented by the standard C library you happen
> > > >to link against.
> > >
> > > It is more efficient to use CreateFile and WriteFile, etc under Win32.
> > >
> >
> > Yes, it definitely is.
> >
> My (unqualified) 2 cents - the major bottlenecks that are likely to exist
> are (a) disk I/O and (b) the network. The overhead introduced by using the
> wrappers in the C library are probably negligible.
> I don't think it's worth making the curl code more complex to use the
> native Win32 functions instead of the stdio stuff.

    Yeah -- its an extra level... Actually, I don't know how neglible
    it is -- I'd have to benchmark it (anyone have a win32 machine
    they'd care to lend me ;)

    But I could imagine it being signifigantly slower on larger files,
    as how many function calls do you think it is (which then translates
    into system calls) to read data from a 3gig file? I don't think
    using native calls on win32 with an option of mmap() (just use it if
    we have it, otherwise don't) in a separate file will be that hard,
    ie, have a seperate file which has the library function:


    Hell, I've got no problem implementing that -- if someone can do the
    win32 testing for me (I'll do the code no problem, I just don't have
    a w32 machine with compilers and all setup) and everyone agree's
    that its the best solution.


Curl-library mailing list
Received on 2001-08-10