Luke,
The test program I have is shown below
#include <stdio.h>
#include <time.h>
void main(int argc, char *argv[]) {
int i;
time_t start,endtime;
time(&start);
for (i=1; i<argc;++i) {
FILE *f;
int c;
fprintf(stderr, "argv[%d]=%s\n", i, argv[i]);
if ((f = fopen(argv[i], "r")) == NULL) {
char buff[1000];
//snprintf(buff, 1000, "Cannot open %s. Skipping...\n", argv[i]);
sprintf(buff, "Cannot open %s. Skipping...\n", argv[i]);
perror(buff);
continue;
}
while(EOF != (c=getc(f)))
putc(c, stdout);
fclose(f);
}
time(&endtime);
fprintf(stderr,"Elapsed (secs) = %6.3f\n",difftime(endtime,start));
}
I am building it with the command lines
2003:
cl -GF -D_CRT_SECURE_NO_DEPRECATE /wd 4430 /wd 4996 -F0x1000000 -O2 -Oy-
-Ob2 -Zi -GS- my_cat.c -o my_c
2005:
cl -GF -D_CRT_SECURE_NO_DEPRECATE /wd 4430 /wd 4996 -F0x1000000 -O2 -Oy-
-Ob2 -Zi -GS- my_cat.c -o my_cat.2005.exe
I mam running it with a command line of
my_cat.2003.exe input input input input >output
my_cat.2005.exe input input input input >output
The input file is a text file of around 28Mbytes.
The 2003 takes 26 seconds and the 2005 is taking 61 seconds.
Our actual application uses fprint etc as well but this is the simplest
example I have to show the difference.
Thanks
[quoted text, click to view] "Luke Zhang [MSFT]" wrote:
> Hello,
>
> can you provide a sample project which can reproduce the problem with
> VS.NET? We will perform further research on the project to see what
> happened.
>
> Sincerely,
>
> Luke Zhang
>
> Microsoft Online Community Support
> ==================================================
> Get notification to my posts through email? Please refer to
>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
>
http://msdn.microsoft.com/subscriptions/support/default.aspx. > ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>