diff mbox

Avoid invoking ranlib on libbackend.a

Message ID alpine.DEB.2.20.13.1607201009280.1419@idea
State New
Headers show

Commit Message

Patrick Palka July 20, 2016, 2:11 p.m. UTC
On Wed, 20 Jul 2016, Bernd Schmidt wrote:

> On 07/19/2016 10:20 AM, Richard Biener wrote:
> > I like it.  Improving re-build time in my dev tree is very much
> > welcome, and yes,
> > libbackend build time is a big part of it usually (plus of course cc1
> > link time).
> 
> Since that wasn't an entirely explicit ack, I'll add mine. Thank you for doing
> this.
> 
> 
> Bernd
> 
> 

Committed as r238524 with the following minor change to the configure
test to use $CFLAGS and $LDFLAGS consistently:

Comments

Andrew Pinski July 22, 2016, 6:19 a.m. UTC | #1
On Wed, Jul 20, 2016 at 7:11 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> On Wed, 20 Jul 2016, Bernd Schmidt wrote:
>
>> On 07/19/2016 10:20 AM, Richard Biener wrote:
>> > I like it.  Improving re-build time in my dev tree is very much
>> > welcome, and yes,
>> > libbackend build time is a big part of it usually (plus of course cc1
>> > link time).
>>
>> Since that wasn't an entirely explicit ack, I'll add mine. Thank you for doing
>> this.
>>
>>
>> Bernd
>>
>>
>
> Committed as r238524 with the following minor change to the configure
> test to use $CFLAGS and $LDFLAGS consistently:

What is interesting is I did not see any change in my bootstrap/test
times.  Constant at 1 hour and 39 minutes (this includes archiving the
build away).
And yes I checked the logs to make sure T option to ar is being used too.

Thanks,
Andrew

>
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 63052ba..241e82d 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -4905,7 +4905,7 @@ echo 'int main (void) { return 0; }' > conftest.c
>  if ($AR --version | sed 1q | grep "GNU ar" \
>      && $CC $CFLAGS -c conftest.c \
>      && $AR rcT conftest.a conftest.o \
> -    && $CC -o conftest conftest.a) >/dev/null 2>&1; then
> +    && $CC $CFLAGS $LDFLAGS -o conftest conftest.a) >/dev/null 2>&1; then
>    thin_archive_support=yes
>  fi
>  rm -f conftest.c conftest.o conftest.a conftest
Patrick Palka July 22, 2016, 12:02 p.m. UTC | #2
On Fri, Jul 22, 2016 at 2:19 AM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Wed, Jul 20, 2016 at 7:11 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
>> On Wed, 20 Jul 2016, Bernd Schmidt wrote:
>>
>>> On 07/19/2016 10:20 AM, Richard Biener wrote:
>>> > I like it.  Improving re-build time in my dev tree is very much
>>> > welcome, and yes,
>>> > libbackend build time is a big part of it usually (plus of course cc1
>>> > link time).
>>>
>>> Since that wasn't an entirely explicit ack, I'll add mine. Thank you for doing
>>> this.
>>>
>>>
>>> Bernd
>>>
>>>
>>
>> Committed as r238524 with the following minor change to the configure
>> test to use $CFLAGS and $LDFLAGS consistently:
>
> What is interesting is I did not see any change in my bootstrap/test
> times.  Constant at 1 hour and 39 minutes (this includes archiving the
> build away).
> And yes I checked the logs to make sure T option to ar is being used too.
>
> Thanks,
> Andrew

Do you see any change in rebuild times in a --disable-bootstrap dev
tree?  On average I guess you'd save about 20s per stage which is a
significant amount of time during development (in a
--disable-bootstrap tree) but not so much when bootstrap/regtesting.
The ar+ranlib invocation is primarily I/O bottlenecked (it writes out
900MB of stuff) so the amount of time saved by using a thin archive
depends on how slow your block device is.

>
>>
>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>> index 63052ba..241e82d 100644
>> --- a/gcc/configure.ac
>> +++ b/gcc/configure.ac
>> @@ -4905,7 +4905,7 @@ echo 'int main (void) { return 0; }' > conftest.c
>>  if ($AR --version | sed 1q | grep "GNU ar" \
>>      && $CC $CFLAGS -c conftest.c \
>>      && $AR rcT conftest.a conftest.o \
>> -    && $CC -o conftest conftest.a) >/dev/null 2>&1; then
>> +    && $CC $CFLAGS $LDFLAGS -o conftest conftest.a) >/dev/null 2>&1; then
>>    thin_archive_support=yes
>>  fi
>>  rm -f conftest.c conftest.o conftest.a conftest
Patrick Palka July 22, 2016, 12:17 p.m. UTC | #3
On Fri, Jul 22, 2016 at 8:02 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> On Fri, Jul 22, 2016 at 2:19 AM, Andrew Pinski <pinskia@gmail.com> wrote:
>> On Wed, Jul 20, 2016 at 7:11 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
>>> On Wed, 20 Jul 2016, Bernd Schmidt wrote:
>>>
>>>> On 07/19/2016 10:20 AM, Richard Biener wrote:
>>>> > I like it.  Improving re-build time in my dev tree is very much
>>>> > welcome, and yes,
>>>> > libbackend build time is a big part of it usually (plus of course cc1
>>>> > link time).
>>>>
>>>> Since that wasn't an entirely explicit ack, I'll add mine. Thank you for doing
>>>> this.
>>>>
>>>>
>>>> Bernd
>>>>
>>>>
>>>
>>> Committed as r238524 with the following minor change to the configure
>>> test to use $CFLAGS and $LDFLAGS consistently:
>>
>> What is interesting is I did not see any change in my bootstrap/test
>> times.  Constant at 1 hour and 39 minutes (this includes archiving the
>> build away).
>> And yes I checked the logs to make sure T option to ar is being used too.
>>
>> Thanks,
>> Andrew
>
> Do you see any change in rebuild times in a --disable-bootstrap dev
> tree?  On average I guess you'd save about 20s per stage which is a
> significant amount of time during development (in a
> --disable-bootstrap tree) but not so much when bootstrap/regtesting.
> The ar+ranlib invocation is primarily I/O bottlenecked (it writes out
> 900MB of stuff) so the amount of time saved by using a thin archive
> depends on how slow your block device is.

... so it's weird that your build times are constant because building
a thin archive is much faster than building a regular archive and
using a thin archive should not make subsequent steps, like linking
that archive, slower.  So overall build times should be lower.

>
>>
>>>
>>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>>> index 63052ba..241e82d 100644
>>> --- a/gcc/configure.ac
>>> +++ b/gcc/configure.ac
>>> @@ -4905,7 +4905,7 @@ echo 'int main (void) { return 0; }' > conftest.c
>>>  if ($AR --version | sed 1q | grep "GNU ar" \
>>>      && $CC $CFLAGS -c conftest.c \
>>>      && $AR rcT conftest.a conftest.o \
>>> -    && $CC -o conftest conftest.a) >/dev/null 2>&1; then
>>> +    && $CC $CFLAGS $LDFLAGS -o conftest conftest.a) >/dev/null 2>&1; then
>>>    thin_archive_support=yes
>>>  fi
>>>  rm -f conftest.c conftest.o conftest.a conftest
Andreas Schwab July 22, 2016, 4:16 p.m. UTC | #4
Patrick Palka <patrick@parcs.ath.cx> writes:

> ... so it's weird that your build times are constant because building
> a thin archive is much faster than building a regular archive and
> using a thin archive should not make subsequent steps, like linking
> that archive, slower.  So overall build times should be lower.

Linking a thin archive requires opening each archive member as a file
instead of only reading within a single file.  This could add some
non-trivial overhead.

Andreas.
diff mbox

Patch

diff --git a/gcc/configure.ac b/gcc/configure.ac
index 63052ba..241e82d 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4905,7 +4905,7 @@  echo 'int main (void) { return 0; }' > conftest.c
 if ($AR --version | sed 1q | grep "GNU ar" \
     && $CC $CFLAGS -c conftest.c \
     && $AR rcT conftest.a conftest.o \
-    && $CC -o conftest conftest.a) >/dev/null 2>&1; then
+    && $CC $CFLAGS $LDFLAGS -o conftest conftest.a) >/dev/null 2>&1; then
   thin_archive_support=yes
 fi
 rm -f conftest.c conftest.o conftest.a conftest