|
From: Luke D. <cod...@ho...> - 2005-05-31 02:14:20
|
The difference is pretty small, and IMHO such a test program won't give =
any useful indication of how real programs will perform. MinGW also uses =
the MSVC malloc() in msvcrt.dll.
Luke
----- Original Message -----=20
From: Marco Vignati=20
To: min...@li...=20
Sent: Monday, May 30, 2005 11:17 PM
Subject: [Mingw-users] malloc slow?
Hi all,
I compiled a malloc test code with MinGW-3.10.0-1 / gcc-3.2.3 and with
MS Visual C++ 6.
With MinGW/gcc time gives:
real 0m3.718s
user 0m0.015s
sys 0m0.000s
and With MS Visual C++:
real 0m2.094s
user 0m0.015s
sys 0m0.000s
The source code of the test program is:
#include <stdlib.h>
int main()
{
int i,*a;
for(i=3D0;i<20000000;i++){
a=3Dmalloc(sizeof(int));
free(a);
}
return 0;
}
I Compiled it with:
gcc -funroll-loops -O3 -o t_malloc t_malloc.c
and in Visual C++ with the "Release" configuration.
Am I omissing any optimization option with gcc??
Thanks in advance
Marco
|