From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2870 invoked by alias); 12 Jan 2018 20:41:59 -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 2795 invoked by uid 89); 12 Jan 2018 20:41:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-100.3 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_BRBL_LASTEXT,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=fastest, assist X-HELO: drew.franken.de Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 20:41:54 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id 1A3E4721BBD15 for ; Fri, 12 Jan 2018 21:41:50 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id BB8F05E019B for ; Fri, 12 Jan 2018 21:41:49 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id A9B37A805A2; Fri, 12 Jan 2018 21:41:49 +0100 (CET) Date: Fri, 12 Jan 2018 20:41:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: calloc speed difference Message-ID: <20180112204149.GF24623@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <46515148-9f8e-6eae-69f9-9bf20921097a@t-online.de> <20180112143339.GE24623@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mojUlQ0s9EVzWg2t" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2018-01/txt/msg00122.txt.bz2 --mojUlQ0s9EVzWg2t Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1735 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 m= ight > >> produce misleading results due to lazy page allocation and/or zero-fil= ling. > >> > >> MinGW binaries use calloc() from msvcrt.dll. This calloc() does not ca= ll > >> malloc() and then memset(). It directly calls: > >> > >> mem =3D HeapAlloc(_crtheap, HEAP_ZERO_MEMORY, size); > >> > >> which possibly only reserves allocate-and-zero-fill-on-demand pages for > >> later. > >> > >> Cygwin's calloc() is different. > >=20 > > But then again, Cygwin's malloc *is* slow, particulary in > > memory-demanding multi-threaded scenarios since that serializes all > > malloc/free calls. > >=20 > > The memory handling within Cygwin is tricky. Attempts to replace good > > old dlmalloc with a fresher jemalloc or ptmalloc failed, but that only > > means the developer (i.e., me, in case of ptmalloc) was too lazy... > > busy! I mean busy... to pull this through. > >=20 > > Having said that, if somebody would like to take a stab at replacing > > dlmalloc with something leaner, I would be very happy and assist as > > much as I can. >=20 > Corina, how reliable is the Cygwin time function on a non-Cygwin > executable? Isn't this a comparison of apples to oranges? I wasn't comparing, in fact. I was just saying that Cygwin's malloc is slow, partially because dlmalloc is not the fastest one, partially due to the serialization overhead in multithreading scenarios. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --mojUlQ0s9EVzWg2t Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlpZHY0ACgkQ9TYGna5E T6DJZhAAlevW+W46bDuOk7rCuB9VBPHqR5g7EhBQAg/CxB7bkQKU6QMv0WGz1q4J QJONOYP5I2ry7z+Snhk1noG43UAlo8TTwNAAI6ubO224PLg4krkUolSmyh/UaodD vJ/I7S44+5Ykmj98T5RHqR+0JB8wqN8nQhlPMYsYVzFVOCK5klnb2CNtTALB/8Pc zdhG0GLcjEwmG9j7nuwX9nxELEngkB4lZ7cW26xYeUX6lp3TJ4rLk21SYJLD0jol MInf9PZFXjQmsZIH3gJ2Ij4b7KrnmmZ1z8C7MWDyntn4PaJgJX+XxSOikh0kHOlm gOVeAPVlKMZb//SPuJCEJ4F/8dQo49opUgSyXEAeDyr8b+iacLtE+FA/6ihfPAyc +nZuUZbkfuJjdA4eB4+yz/sQwsLvEJ9MU7J+SwcVujjFja0e1+2IcP4TLb5GU1qt h9FznDDGVXbYCGqMYBzK6souhpr9wKbsbvPgFTQXJJDlG4z52MDN2QGIGSJaFoJi v4XKZ70TGzbV0hh4kvFn4zriCbKtieq/HJcybtPJ8BJcDvxNLoPTIpdjRKgRpeIM f6Q0Y+qWrSTVGuJ8NJHNG0BwvajA9aJ69LUrxBNFqdoRhx4Y4r4S6HJPpyF9TwSo 5x6SiJexR43fWtRdDxYlZjNKwKz4r4sEspwZXm4bIaOex0aq6RE= =C5uz -----END PGP SIGNATURE----- --mojUlQ0s9EVzWg2t--