delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; q=dns; s= | |
default; b=XPNm5xsK1jdWYGZb+eZNbZXcy30Zm2Anw8fF9kci61mWpMB8c0umn | |
WyByRSkIloYFXdQFlI4Pc9N0jYoIlcD42epV8HrRfwkq204UfAbo6mepiEF/1ZLM | |
1u+yryMn2ur+ctEEylkN+gPCSwQwuYyIaqMqFt1KLWUyl/5b1wOPZA= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; s=default; | |
bh=0vbO1gyI+JmOzdxWUKyk1ktlJsY=; b=NaqKuU5HetJxckbc4oMm2iCbyBg+ | |
+3NjH4V2c7Bmqyu83TlpI9jjdGsYmzAkcw1xbpPHXXFwVdNl4oveDyEtlOlOrg/G | |
oevOdhXi5KJ4g32Z5RSw6FA6skNINmiCiTBi4i+NSDWiZFxoSZ54zTQgMco3dF3I | |
lLPUJ/ub3BTSB/U= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
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 |
Date: | Fri, 12 Jan 2018 21:41:49 +0100 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: calloc speed difference |
Message-ID: | <20180112204149.GF24623@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <CAD8GWsvxzFe0dPnxO-odTY+EG5XOAApLjcOSN5d7vXhtLW0GmQ AT mail DOT gmail DOT com> <46515148-9f8e-6eae-69f9-9bf20921097a AT t-online DOT de> <20180112143339 DOT GE24623 AT calimero DOT vinschen DOT de> <b7ab3fe3-fa81-432d-33ad-9c0d7948b044 AT gmail DOT com> |
MIME-Version: | 1.0 |
In-Reply-To: | <b7ab3fe3-fa81-432d-33ad-9c0d7948b044@gmail.com> |
User-Agent: | Mutt/1.9.1 (2017-09-22) |
--mojUlQ0s9EVzWg2t Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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" -----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--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |