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.
----- Original Message -----
From: Marco Vignati
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;
  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