From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11350 Path: news.gmane.org!.POSTED!not-for-mail From: "maksis ." Newsgroups: gmane.linux.lib.musl.general Subject: towlower performance Date: Thu, 25 May 2017 18:01:46 +0000 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_VI1P192MB011211DE6A9BDC8F4AF61CB6FBFF0VI1P192MB0112EURP_" X-Trace: blaine.gmane.org 1495735322 7133 195.159.176.226 (25 May 2017 18:02:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 May 2017 18:02:02 +0000 (UTC) To: "musl@lists.openwall.com " Original-X-From: musl-return-11365-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 25 20:01:58 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dDx5C-0001kz-79 for gllmg-musl@m.gmane.org; Thu, 25 May 2017 20:01:58 +0200 Original-Received: (qmail 30498 invoked by uid 550); 25 May 2017 18:02:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30471 invoked from network); 25 May 2017 18:01:58 -0000 Thread-Topic: towlower performance Thread-Index: AQHS1XgsgD0/HjMOaE60zd6amPjqIQ== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.openwall.com; dkim=none (message not signed) header.d=none;lists.openwall.com; dmarc=none action=none header.from=adrenaline-network.com; x-incomingtopheadermarker: OriginalChecksum:1F5DB67B2121C0971865C18653CB99DF5ACB9854F2102DE94A2BBBB586C0F784;UpperCasedChecksum:CB1B254E05838E9C349F401CCA686EEC739EE2B97EA1381487073DD6044672CF;SizeAsReceived:8150;Count:42 x-tmn: [2po9VyVk1z4lnSRDkli/1Oo+eYs6TNGsY2SBcNUqPgH3XdH259P6nUW6syI6k/JaZl5GDwhrueI=] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VE1EUR03HT241;5:8zv4UBXhuzoO4leEw217Eo1ZDw/17zN50MOEN890DAM0xNMwbgNPW6ovHXL1UJ/1G5oCDTKtlq+9+nEcnikCDbMnYvjqQsfKu1U0mHztQWzjS0eYVKwT7eSCN77Lah8Xy+Q6NvCgqrvb2tqEDqyH1a9yyEjwP1Db7Z3ggRsGW6c=;24:fnWtqOLCaGn6TOq5pGZ2PckO3ZlB2sVY7Ssvw9t0KEL1TzXtI22ebwcT2u3PyeGvVJYZ9s+bpHzApX3uOgoh4G0ZJMXwDkW9PyTUwNtaPHg=;7:NqkSpZgw8SdZobTryA1Xg5HTgMrKkgpkUwksHrmY1cr5lzhVR4G/rc1fFi8FX01+pXgsGov7i9YmbCTqI+VR8gF4cGx8zcZ3mgXptKC/SvKwJbzSChCZpSlyxm3z9PxGnzigt0QRSlZ1TaRu1tuWJxWYvX9eeSUNYWowc6GWo2n7k2dDoCFM5Zas1POdHFoT+KCjJVPzGkKl4x+QmUjiMwRD5cY7cGBeNOJ9kWjEydfdBp8uhEE1GXq+CPz7chdI8Y2fvGrfH+LwsV3EX8tg9BBFPFWbGUv2cTRgqnHIfGTdfIs55ydA06LW/TYFUiBm x-incomingheadercount: 42 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:VE1EUR03HT241;H:VI1P192MB0112.EURP192.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: 1140408e-7a7b-4110-5d86-08d4a3981c0d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322274)(1601125374)(1603101448)(1701031045);SRVR:VE1EUR03HT241; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(444000031);SRVR:VE1EUR03HT241;BCL:0;PCL:0;RULEID:;SRVR:VE1EUR03HT241; x-forefront-prvs: 0318501FAE spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2017 18:01:46.5826 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT241 Xref: news.gmane.org gmane.linux.lib.musl.general:11350 Archived-At: --_000_VI1P192MB011211DE6A9BDC8F4AF61CB6FBFF0VI1P192MB0112EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, After switching my C++ app from a glibc-based build to a static build using= musl, I've noticed significant differences in performance with certain loa= ding operations, which seems to be related to using std::map with a case-in= sensitive UTF-8 sorting algorithm. For example, parsing a XML file with a f= lat listing of ~350k directory items and mapping them by name takes about 3= seconds with glibc vs 13 seconds with musl. After modifying the sort algor= ithm by removing all calls to towlower, the loading time with musl drops to= 3.5 seconds. I put together a C++ benchmark with the same sorting algorithm, which seems= to produce similar results (GCC 6.3, 64 bit, -O3): https://gist.github.com/maksis/92ad04f525d69043283350675d04f160 glibc: ~2 seconds (Arch Linux) musl: ~7 seconds (Alpine Linux 3.6.0) What might be causing the difference? --_000_VI1P192MB011211DE6A9BDC8F4AF61CB6FBFF0VI1P192MB0112EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

After switching my C++ app from a glibc-base= d build to a static build using musl, I've noticed significant differences = in performance with certain loading operations, which seems to be related t= o using std::map with a case-insensitive UTF-8 sorting algorithm. For example, parsing a XML file with a flat listing of = ~350k directory items and mapping them by name takes about 3 seconds with g= libc vs 13 seconds with musl. After modifying the sort algorithm by removin= g all calls to towlower, the loading time with musl drops to 3.5 seconds.

 

I put together a C++ benchmark with the same= sorting algorithm, which seems to produce similar results (GCC 6.3, 64 bit= , -O3):

 

https://gist.github.com/maksis/92ad04f525d690432833= 50675d04f160

 

glibc: ~2 seconds (Arch Linux)

musl: ~7 seconds (Alpine Linux 3.6.0)

 

 

What might be causing the difference?

--_000_VI1P192MB011211DE6A9BDC8F4AF61CB6FBFF0VI1P192MB0112EURP_--