From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68786 invoked by alias); 12 Jan 2018 07:19:44 -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 68776 invoked by uid 89); 12 Jan 2018 07:19:44 -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= X-HELO: mail-it0-f43.google.com Received: from mail-it0-f43.google.com (HELO mail-it0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 07:19:42 +0000 Received: by mail-it0-f43.google.com with SMTP id u62so7995880ita.2 for ; Thu, 11 Jan 2018 23:19:42 -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:from:date:message-id:subject:to; bh=bGmsKksL3drI3tEiw5bkEQ8Jx43BVR3uwoTIK1olUrQ=; b=FVFhWq+BAG1xkPoqlpq0LdbT7h26e3Y49F7hDSSXsVOyFU4da8Leej0gWS3Ovkm+un TRu2+8ye9UlJtqSzqJHa6S4zAieybQ6JD7GJxQ9v599cYAnBXEoZ5I2eDmagVpMxZb6u 70XxcsVQ7vumOEeZk1eXjVHlsZgAX3xqBcG5YyeRCrqRFUIjVV4JhpAi8ymA3ErZNNKH 1u1fKXqFiU5pinIgJk2Syc2c+wCc0K8GMQKqQHoETdEyBTah6/EECSzn/zCwTTNivTZ9 6p/WJ74w/OOSBVSowZvGYTYLNHw2hDy4oCqi1JWymMVePO0gqsR7CKXigwHjGCOkWfSE MM7g== X-Gm-Message-State: AKwxytcgOGACoKANbHHnDYqR7mdycpROxvXivae+MYhdVeCn36zyCKUm HKcaNRHSnAlvUQx/BjbvSfGiv1jsXdjY/rGYmHA= X-Google-Smtp-Source: ACJfBos15iVfjLE0llxGRlNWq/nUwZUE7lj70QFJXF+MAm1NorOZJNBPAReHfm00QadEvZ0XmUiTyJFBxIP1N+8Qfok= X-Received: by 10.36.160.5 with SMTP id o5mr3728610ite.79.1515741580963; Thu, 11 Jan 2018 23:19:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.147.218 with HTTP; Thu, 11 Jan 2018 23:19:40 -0800 (PST) From: Lee Date: Fri, 12 Jan 2018 07:19:00 -0000 Message-ID: Subject: calloc speed difference To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00105.txt.bz2 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 $i686-w64-mingw32-gcc calloc-test.c $time ./a real 0m11.119s user 0m0.000s sys 0m0.000s $gcc calloc-test.c $time ./a real 1m12.323s user 0m0.656s sys 1m11.640s $i686-w64-mingw32-gcc calloc-test.c $time ./a real 0m11.080s user 0m0.000s sys 0m0.000s $ $ gcc --version gcc (GCC) 6.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ i686-w64-mingw32-gcc --version i686-w64-mingw32-gcc (GCC) 6.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- 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