Click here to Skip to main content
15,922,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Neville Franks26-Dec-02 14:39
Neville Franks26-Dec-02 14:39 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Chris Losinger26-Dec-02 15:13
professionalChris Losinger26-Dec-02 15:13 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Neville Franks26-Dec-02 15:50
Neville Franks26-Dec-02 15:50 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Matt Gullett26-Dec-02 15:49
Matt Gullett26-Dec-02 15:49 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Chris Losinger26-Dec-02 19:00
professionalChris Losinger26-Dec-02 19:00 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Michael Dunn26-Dec-02 18:52
sitebuilderMichael Dunn26-Dec-02 18:52 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Chris Losinger26-Dec-02 18:59
professionalChris Losinger26-Dec-02 18:59 
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Mike Nordell27-Dec-02 1:22
Mike Nordell27-Dec-02 1:22 
Chris Losinger wrote:
fwrite, fread and friends are easily many times faster than WriteFile, ReadFile and friends, when doing lots of small reads and writes.

Expected. The Win32 functions need to (among other things) do user->kernel->user mode transitions, which is horribly slow in IA32. The stdio functions perform buffering all in user-mode (no context switch until the buffer is full), and you can even increase the buffer with setvbuf (disregard any Micros~1 documentation lying to you that you can only use 32KB buffers - the buffer can be all the memory you can give it. Probably they haven't bothered to update the documentation from the ~1990 MS-DOS CRT limits).

If you are only given a file HANDLE (from e.g. a DLL) and want faster stdio functions, you should have a look at _open_osfhandle. That should put you on the right track.
GeneralRe: WriteFile = slow; fwrite = fast; me = sad; Pin
Chris Losinger27-Dec-02 6:27
professionalChris Losinger27-Dec-02 6:27 
GeneralControls on an MDI App Pin
Steven M Hunt26-Dec-02 11:51
Steven M Hunt26-Dec-02 11:51 
GeneralLIB from DLL Pin
Hockey26-Dec-02 11:30
Hockey26-Dec-02 11:30 
GeneralRe: LIB from DLL Pin
Neville Franks26-Dec-02 13:06
Neville Franks26-Dec-02 13:06 
GeneralRe: LIB from DLL Pin
Hockey26-Dec-02 17:35
Hockey26-Dec-02 17:35 
GeneralRe: LIB from DLL Pin
Neville Franks26-Dec-02 18:51
Neville Franks26-Dec-02 18:51 
GeneralRe: LIB from DLL Pin
Chris Losinger26-Dec-02 15:15
professionalChris Losinger26-Dec-02 15:15 
GeneralRe: LIB from DLL Pin
Hockey26-Dec-02 17:37
Hockey26-Dec-02 17:37 
GeneralRe: LIB from DLL Pin
Mike Nordell27-Dec-02 1:25
Mike Nordell27-Dec-02 1:25 
Generalthree views + three opengl windows + crashes when fullscreen Pin
bbbilen26-Dec-02 9:54
bbbilen26-Dec-02 9:54 
GeneralRe: three views + three opengl windows + crashes when fullscreen Pin
KaЯl26-Dec-02 23:49
KaЯl26-Dec-02 23:49 
GeneralRe: three views + three opengl windows + crashes when fullscreen Pin
bbbilen29-Dec-02 8:36
bbbilen29-Dec-02 8:36 
Generalc++ and managed c++ Pin
joshfl26-Dec-02 8:30
joshfl26-Dec-02 8:30 
GeneralRe: c++ and managed c++ Pin
AlexO26-Dec-02 8:37
AlexO26-Dec-02 8:37 
GeneralRe: c++ and managed c++ Pin
S O S26-Dec-02 9:47
S O S26-Dec-02 9:47 
GeneralRe: c++ and managed c++ Pin
Vagif Abilov26-Dec-02 9:45
professionalVagif Abilov26-Dec-02 9:45 
GeneralRe: c++ and managed c++ Pin
Nish Nishant26-Dec-02 10:24
sitebuilderNish Nishant26-Dec-02 10:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.