X-Original-To: alpine-devel@lists.alpinelinux.org Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) by lists.alpinelinux.org (Postfix) with ESMTP id 79B9F5C5923 for ; Wed, 25 Oct 2017 15:38:59 +0000 (GMT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=date:from:to:cc:message-id:in-reply-to:references:subject:mime-version:content-type:user-agent; b=hdMgrmIAKxkVWnlz8wsrCKcKPFGwH0XIQCh7P+1RA/X4T81VH0JcZOSUuzfVQ66vAwZrA537zqRj /wouhHWYaE7AeqC2D+SxniRm6kVQIO4Paa6uIgK8h/uRJSaSbtxW Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1508945937364583.6133516350931; Wed, 25 Oct 2017 08:38:57 -0700 (PDT) Received: from [89.76.36.159] by mail.zoho.com with HTTP;Wed, 25 Oct 2017 08:38:41 -0700 (PDT) Date: Wed, 25 Oct 2017 17:38:57 +0200 From: =?UTF-8?Q?Przemys=C5=82aw_Pawe=C5=82czyk?= To: "Natanael Copa" Cc: Message-ID: <15f542f8688.cf7ee9da1704.8790472834519953285@zoho.com> In-Reply-To: <20171025164614.14c4c57e@ncopa-desktop.copa.dup.pw> References: <20171025164614.14c4c57e@ncopa-desktop.copa.dup.pw> Subject: Re: [alpine-devel] force compile flag for musl? X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail ---- On Wed, 25 Oct 2017 16:46:14 +0200 Natanael Copa wrote ---- > I wonder what you think about overriding the -Os compile flag for musl, > and hardcode it to -O2. I would be very careful with such changes. There is misconception that the higher optimization level, the faster code is generated. That is the general -Olevel idea, but not what is seen in practice. Gains (or losses) from higher optimization levels vary between archs and obviously depend on the code that is being optimized. Smaller code, beside being smaller, is also more cache-friendly, so -Os can be faster than -O2 and often is. OTOH higher optimization levels for x86-64 usually tend to give better results than on other archs. There is no rule. It all depends on: - source code, - compiler, - platform. > > I think this makes sense since the functions in libc are so often used > that we want trade better performance at the cost of slightly bigger > binary. This makes sense if we really get better performance with -O2 on all platforms AL supports. And to be able to confirm that, it has te be measured. > > This means that we override whatever user as set CFLAGS to > in /etc/abuild.conf > > We already do this with zlib. zlib is a different beast, because it's computational software. It's much more natural to see gains from higher -Olevel in that kind of apps. > > What do you think? There were similar changes in aports for various applications over recent months, but I haven't seen even one proof behind them. Performance improvements are imporant, and they may come from simply bumping optimization level, but it should be verified, not blindly assumed. Regards, Przemek > > diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD > index 1938bbb3ca..193002186d 100644 > --- a/main/musl/APKBUILD > +++ b/main/musl/APKBUILD > @@ -54,6 +54,8 @@ build() { > fi > > # note: not autotools > + # force -O2 compile flag for better performance > + CFLAGS="-O2" \ > LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-${CARCH}.so.1" \ > ./configure \ > --build=$CBUILD \ > > -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---