Re: getc( ) and gets( ) speed

new topic     » goto parent     » topic index » view thread      » older message » newer message

Me wrote:

<big snip>

> I wrote a small program that compares the speed of gets(), get_bytes(),
> and your Windows API code.

I just realized, that in the functions read_file1() and read_file2(),
it should be
   fn = open(fileName, "rb")
rather than
   fn = open(fileName, "r").

> On my Pentium 2, 400 MHz, 64 MB RAM (under
> Win 98/1st ed.), the results for reading a 10 MB text file, consisting
> of 150000 lines are as follows:
> 1.13 sec. using gets()                -- 2 times faster than get_bytes()
> 2.25 sec. using get_bytes()
> 0.70 sec. using Windows API routines  -- 3 times faster than get_bytes()

The speed of the functions remain unchanged.

<big snip>

Regards,
   Juergen

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu