From: Lee <ler762@gmail.com>
To: cygwin@cygwin.com
Subject: Re: calloc speed difference
Date: Fri, 12 Jan 2018 10:52:00 -0000 [thread overview]
Message-ID: <CAD8GWssPKHMe9fomrfEJGEm+G83iZeXovPmkNbYBdD0rZ7r45w@mail.gmail.com> (raw)
In-Reply-To: <d398824d-32fe-3b3c-23ae-eebc5da1c3af@gmail.com>
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 <stdio.h>
>> #include <stdlib.h>
>> #define ALLOCATION_SIZE (100 * 1024 * 1024)
>> int main (int argc, char *argv[]) {
>> for (int i = 0; i < 10000; i++) {
>> void *temp = calloc(ALLOCATION_SIZE, 1);
>> if ( temp == NULL ) {
>> printf("drat! calloc returned NULL\n");
>> return 1;
>> }
>> free(temp);
>> }
>> return 0;
>> }
>>
>> $gcc calloc-test.c
>> $time ./a
>>
>> real 1m12.459s
>> user 0m0.640s
>> sys 1m11.750s
>
> it seems a local problem, maybe BLODA?
I've seen windows defender get in the way & slow things down before -
this doesn't look anything like that but how does one know for sure?
when running the cygwin gcc version sysinternals process explorer shows
system idle process 72.x
a.exe 24.9x
procexp64.exe 1.x
and everything else is < 1%
CPU is an Intel i3 w/ 4 logical processors, so I'm guessing that 25%
cpu busy is one processor 100% busy
It looks roughly the same when running the mingw gcc version .. except
that a.exe shows 24.9x% cpu busy for a much shorter time :)
In any case, I tried turning off windows defender - no change in how
long it takes calloc-test to run (i already had c:\cygwin in the
exclusion list)
> 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 that
builds an executable that runs "native" windows code?
Thanks,
Lee
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2018-01-12 10:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-12 7:19 Lee
2018-01-12 8:38 ` Eliot Moss
2018-01-12 9:07 ` Marco Atzeri
2018-01-12 10:52 ` Lee [this message]
2018-01-21 11:01 ` Marco Atzeri
2018-01-12 14:05 ` Christian Franke
2018-01-12 14:33 ` Corinna Vinschen
2018-01-12 19:59 ` cyg Simple
2018-01-12 20:07 ` cyg Simple
2018-01-12 20:41 ` Corinna Vinschen
2018-01-12 22:34 ` cyg Simple
2018-01-13 10:48 ` Lee
2018-01-13 10:04 ` Lee
2018-01-12 22:00 ` Eliot Moss
2018-01-13 8:35 ` Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAD8GWssPKHMe9fomrfEJGEm+G83iZeXovPmkNbYBdD0rZ7r45w@mail.gmail.com \
--to=ler762@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).