Hi, I'm new on this list, and I hope I'm asking my question at right place.
I tried to test the bandwidth of a DDR3 memory in random access mode, and I wrote a simple code for this purpose. I compiled it with gcc-4.1.1 for Linux and with mingw-4.2.1-sjlj for Windows. After I tried the executables I saw that the windows version runs more then 10 times faster than the linux version. My test routine is very simple. I fill up two arrays with random numbers: int *memRand1, *memRand2; And I also allocate two more arrays to move data between them (2 x 256MB). float *mem1, *mem2; So, I would like to move data from "mem2" into "mem1" randomly with this function: for ( i=0; i<nofMoves; i++ ) { mem1[ memRand1[i] ] = mem2[ memRand2[i] ]; } If I compile this code under linux it runs with unacceptable speed (very slow). If I compile it with mingw32 compiler, or VisualC++ then it gives good result. Here are my results for memory bandwith test: Linux: 373.574249 MB/s Win32: 4468.297363 MB/s Me (and some of my colleges) tried to compile the code with gcc/g++ 4.1.3, 4.2.4, 4.3.4, 4.4.1 with different compiler options (-O,-O2,-O3, -m32, -m64..etc) under different Linux distros, but the result is always the same. We tried to run the code with wine, and with Windows7 also, and both of them are faster than native Linux. Why? I attached the c source code, unix Makefile, and the "ii" and "s" files created with --save-temps option. Thanks for any help, Bela Mihalik
random-mem-test.tar.bz2
Description: BZip2 compressed data