From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90653 invoked by alias); 12 Jan 2018 10:52:12 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 90631 invoked by uid 89); 12 Jan 2018 10:52:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=busy, pulls, exclusion, 1x X-HELO: mail-io0-f195.google.com Received: from mail-io0-f195.google.com (HELO mail-io0-f195.google.com) (209.85.223.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 10:52:10 +0000 Received: by mail-io0-f195.google.com with SMTP id v30so5417640iov.7 for ; Fri, 12 Jan 2018 02:52:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=nTW6xZkCQYCcg6cBcf65spDMpKf6jsXDoXUPRaMiOZI=; b=J8ZBCb3t91oMSQ11tLrzfousrsJJujWQLa8eqeioS27Q+8M+YO1SM/TPf+Yuxj3Hzj RB3fwnECEXqEZUrmrs31H1TvM3gc8X0OmtWk/EAkvWUUnQS10a3/78exNbhiwMuRFoZo 7pa7i/F4R4KZRyH5VYqUCMoSWfVwufXEiTy9zoSJmWvyw4MQrQI7utcpxtFZv9WYaFfk +sQ4/HgNgrXqwktnGZavS79qC9PFw2fH1ho0SYH2GnRmpUIYLlY/3QpWDTN3YTOGAZk8 rw/ngwCTC+oIGDI7GBVIW8LvZh8VmJL6icG7ksZYTVNtYql1vJSB/kzPMOGWHJtN961y CTCA== X-Gm-Message-State: AKGB3mKei+js3behf3mnUdMTxv7pUVReOC0+HTbHxHzEMsHHtrYZyYn+ kR6BLG0ZLTFS0IALJxrI88pEteWtz0KwCuvWgEc= X-Google-Smtp-Source: ACJfBotqit5JYYo37YuBDZtfRaRfL0zelNmJuAyPn5nUb63qlLq8wutszpzZfwiGFf0o6cKDcEofBLmiUuSPBRJ1sjE= X-Received: by 10.107.166.18 with SMTP id p18mr25697202ioe.158.1515754328943; Fri, 12 Jan 2018 02:52:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.147.218 with HTTP; Fri, 12 Jan 2018 02:52:08 -0800 (PST) In-Reply-To: References: From: Lee Date: Fri, 12 Jan 2018 10:52:00 -0000 Message-ID: Subject: Re: calloc speed difference To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00109.txt.bz2 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 *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