Subj : Re: scrolling slower in 32 bits mode than in 16. To : borland.public.cpp.borlandcpp From : Morosh Date : Fri Mar 11 2005 05:22 pm Bob Gonder wrote in message news:hcc131dqt6r66kipj3rs3lu6t3j1dmiudi@4ax.com... > Morosh wrote: > > >I wrote a program and I was compiling it in 16 bits mode using bcc (borland > >v5.02) > >I tried to compile with bcc32 (as there is less problem for data space) > >It worked but the scrolling was very much slower than with bcc. > > > >To isolate the problem, I wrote a very simple program to test the scrolling: > > > >#include "stdio.h" > >void main() > >{ > >int i; > >for(i=32;i<1024;i++) printf("%i ",i); > >} > > >My question is: is there a way to have scrolling under 32bits as fast as > >under 16 bits > > See if this is any faster (not tested)? > > #include > > int main() > { > int i; > DWORD byteswritten; > char msg[64]; > HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE); > > SetConsoleMode(stdout,ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT); > > for(i=32;i<1024;++i) > { wsprintf( msg, "%i", i ); > WriteFile(stdout,msg,lstrlen(msg),&byteswritten,NULL); > }; > return 0; > } > In my own app, I completely control the screen, never scroll, and turn > off WRAP_AT_EOL. I also don't use any C/C++ console functions, using > pure Win32 API. (My clear screen is about 10 times faster than the CRL > version). > > >I compiled it with bcc: bcc -4 -ff -N -ml test.cpp > >and with bcc32: bcc32 -6 -fp -N -d test.cpp > > -ff and -fp are floating point, and have no affect on this program. > I can't find a -N switch for bcc32 > You should also specify the target: -WC > And, when you get into bigger programs, look to add -O2 -Oi -OS -Ov > > Hi: I tried your code, the result is the same, but I noticed that the difference is only under WIN98 (16bits is faster than 32 bits), under WIN XP both are identical and slow like 32bits mode under 98. any idea? thanks .