Re: calloc speed difference

2018-01-21 Thread Marco Atzeri
On 12/01/2018 18:52, Lee wrote: On 1/12/18, Marco Atzeri wrote: On 12/01/2018 08:19, Lee wrote: I have roughly the same for both 32 and 64 cygwin version on W7-64 which flavor of gcc - the cygwin version that builds an executable that pulls in the posix emulation layer or the mingw version

Re: calloc speed difference

2018-01-13 Thread Lee
On 1/12/18, cyg Simple wrote: > On 1/12/2018 3:41 PM, Corinna Vinschen wrote: >> On Jan 12 14:59, cyg Simple wrote: >>> On 1/12/2018 9:33 AM, Corinna Vinschen wrote: On Jan 12 15:06, Christian Franke wrote: > Timing [cm]alloc() calls without actually using the allocated memory > might

Re: calloc speed difference

2018-01-13 Thread Lee
On 1/12/18, Corinna Vinschen wrote: > On Jan 12 15:06, Christian Franke wrote: >> Lee wrote: >> > Why is the cygwin gcc calloc so much slower than the >> > i686-w64-mingw32-gcc calloc? >> >1:12 vs 0:11 <.. snip example prog ..> >> >> Could reproduce the difference on an older i7-2600K mach

Re: calloc speed difference

2018-01-13 Thread Lee
On 1/12/18, Christian Franke wrote: > Lee wrote: >> Why is the cygwin gcc calloc so much slower than the >> i686-w64-mingw32-gcc calloc? >>1:12 vs 0:11 >> >> $cat calloc-test.c >> #include >> #include >> #define ALLOCATION_SIZE (100 * 1024 * 1024) >> int main (int argc, char *argv[]) { >>

Re: calloc speed difference

2018-01-12 Thread cyg Simple
On 1/12/2018 3:41 PM, Corinna Vinschen wrote: > On Jan 12 14:59, cyg Simple wrote: >> On 1/12/2018 9:33 AM, Corinna Vinschen wrote: >>> On Jan 12 15:06, Christian Franke wrote: Timing [cm]alloc() calls without actually using the allocated memory might produce misleading results due to laz

Re: calloc speed difference

2018-01-12 Thread Eliot Moss
On 1/12/2018 9:06 AM, Christian Franke wrote: This variant of the above code adds one write access to each 4KiB page (guarded by "volatile" to prevent dead assignment optimization): #include #include #define ALLOCATION_SIZE (100 * 1024 * 1024) int main (int argc, char *argv[]) {     for (in

Re: calloc speed difference

2018-01-12 Thread Corinna Vinschen
On Jan 12 14:59, cyg Simple wrote: > On 1/12/2018 9:33 AM, Corinna Vinschen wrote: > > On Jan 12 15:06, Christian Franke wrote: > >> Timing [cm]alloc() calls without actually using the allocated memory might > >> produce misleading results due to lazy page allocation and/or zero-filling. > >> > >>

Re: calloc speed difference

2018-01-12 Thread cyg Simple
On 1/12/2018 2:59 PM, cyg Simple wrote: > On 1/12/2018 9:33 AM, Corinna Vinschen wrote: >> On Jan 12 15:06, Christian Franke wrote: >>> Lee wrote: Why is the cygwin gcc calloc so much slower than the i686-w64-mingw32-gcc calloc? 1:12 vs 0:11 $cat calloc-test.c #incl

Re: calloc speed difference

2018-01-12 Thread cyg Simple
On 1/12/2018 9:33 AM, Corinna Vinschen wrote: > On Jan 12 15:06, Christian Franke wrote: >> Lee wrote: >>> Why is the cygwin gcc calloc so much slower than the >>> i686-w64-mingw32-gcc calloc? >>>1:12 vs 0:11 >>> >>> $cat calloc-test.c >>> #include >>> #include >>> #define ALLOCATION_SIZE (10

Re: calloc speed difference

2018-01-12 Thread Corinna Vinschen
On Jan 12 15:06, Christian Franke wrote: > Lee wrote: > > Why is the cygwin gcc calloc so much slower than the > > i686-w64-mingw32-gcc calloc? > >1:12 vs 0:11 > > > > $cat calloc-test.c > > #include > > #include > > #define ALLOCATION_SIZE (100 * 1024 * 1024) > > int main (int argc, char *a

Re: calloc speed difference

2018-01-12 Thread Christian Franke
Lee wrote: Why is the cygwin gcc calloc so much slower than the i686-w64-mingw32-gcc calloc? 1:12 vs 0:11 $cat calloc-test.c #include #include #define ALLOCATION_SIZE (100 * 1024 * 1024) int main (int argc, char *argv[]) { for (int i = 0; i < 1; i++) { void *temp = calloc(

Re: calloc speed difference

2018-01-12 Thread Lee
On 1/12/18, Marco Atzeri wrote: > On 12/01/2018 08:19, Lee wrote: >> Why is the cygwin gcc calloc so much slower than the >> i686-w64-mingw32-gcc calloc? >>1:12 vs 0:11 >> >> $cat calloc-test.c >> #include >> #include >> #define ALLOCATION_SIZE (100 * 1024 * 1024) >> int main (int argc, char

Re: calloc speed difference

2018-01-12 Thread Marco Atzeri
On 12/01/2018 08:19, Lee wrote: Why is the cygwin gcc calloc so much slower than the i686-w64-mingw32-gcc calloc? 1:12 vs 0:11 $cat calloc-test.c #include #include #define ALLOCATION_SIZE (100 * 1024 * 1024) int main (int argc, char *argv[]) { for (int i = 0; i < 1; i++) {

Re: calloc speed difference

2018-01-12 Thread Eliot Moss
On 1/12/2018 2:19 AM, Lee wrote: Why is the cygwin gcc calloc so much slower than the i686-w64-mingw32-gcc calloc? Since your test repeatedly allocates and frees one chunk of size 100 Mb (ouch!) my guess is that the slow behavior is rooted in something to do with mmap. Perhaps Corinna or anoth

calloc speed difference

2018-01-11 Thread Lee
Why is the cygwin gcc calloc so much slower than the i686-w64-mingw32-gcc calloc? 1:12 vs 0:11 $cat calloc-test.c #include #include #define ALLOCATION_SIZE (100 * 1024 * 1024) int main (int argc, char *argv[]) { for (int i = 0; i < 1; i++) { void *temp = calloc(ALLOCATION_SIZE,