I have a command-line utility, which uses a lot of basic C stuff like strcat and psz's to create several megabytes of output which is just printed to stdout and redirected to a file. This utility works quite fast, creating >10Mb in few seconds. The util was compiled with VC6.
I then wanted to create a nice gui for the utility, and made the interface (an MFC project). I used the exact same code for the engine part of the app, except that it fills heap with the output instead of stdoutting anything, and once finished writes this to a file. Now, the engine code which runs in its own worker thread is _enormously_ slower (takes several minutes to do what the command line version creates in seconds) in the gui version, and it still takes 99% of cpu time.
Any ideas what might cause this huge performance difference?
I then wanted to create a nice gui for the utility, and made the interface (an MFC project). I used the exact same code for the engine part of the app, except that it fills heap with the output instead of stdoutting anything, and once finished writes this to a file. Now, the engine code which runs in its own worker thread is _enormously_ slower (takes several minutes to do what the command line version creates in seconds) in the gui version, and it still takes 99% of cpu time.
Any ideas what might cause this huge performance difference?