netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next] Makefile: pass -pipe to the compiler
@ 2019-06-11 18:05 Matteo Croce
  2019-06-11 19:28 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Matteo Croce @ 2019-06-11 18:05 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern

Pass the -pipe option to GCC, to use pipes instead of temp files.
On a slow AMD G-T40E CPU we get a non negligible 6% improvement
in build time.

real    1m15,111s
user    1m2,521s
sys     0m12,465s

real    1m10,861s
user    1m2,520s
sys     0m12,901s

Signed-off-by: Matteo Croce <mcroce@redhat.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 48f469b0..6c35e7c2 100644
--- a/Makefile
+++ b/Makefile
@@ -48,7 +48,7 @@ HOSTCC ?= $(CC)
 DEFINES += -D_GNU_SOURCE
 # Turn on transparent support for LFS
 DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-CCOPTS = -O2
+CCOPTS = -O2 -pipe
 WFLAGS := -Wall -Wstrict-prototypes  -Wmissing-prototypes
 WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next] Makefile: pass -pipe to the compiler
  2019-06-11 18:05 [PATCH iproute2-next] Makefile: pass -pipe to the compiler Matteo Croce
@ 2019-06-11 19:28 ` Stephen Hemminger
  2019-07-14 16:36   ` Matteo Croce
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2019-06-11 19:28 UTC (permalink / raw)
  To: Matteo Croce; +Cc: netdev, David Ahern

On Tue, 11 Jun 2019 20:05:13 +0200
Matteo Croce <mcroce@redhat.com> wrote:

> Pass the -pipe option to GCC, to use pipes instead of temp files.
> On a slow AMD G-T40E CPU we get a non negligible 6% improvement
> in build time.
> 
> real    1m15,111s
> user    1m2,521s
> sys     0m12,465s
> 
> real    1m10,861s
> user    1m2,520s
> sys     0m12,901s
> 
> Signed-off-by: Matteo Croce <mcroce@redhat.com>

Why bother, on my machine (make -j12).

Before
real	0m6.320s
user	0m30.674s
sys	0m3.649s


After (with -pipe)
real	0m6.158s
user	0m31.197s
sys	0m3.532s


So it is slower. Get a faster disk :-)

Maybe allow "EXTRA_CFLAGS" to be passed to Makefile for those that
have a burning need for this.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next] Makefile: pass -pipe to the compiler
  2019-06-11 19:28 ` Stephen Hemminger
@ 2019-07-14 16:36   ` Matteo Croce
  0 siblings, 0 replies; 3+ messages in thread
From: Matteo Croce @ 2019-07-14 16:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, David Ahern

On Tue, Jun 11, 2019 at 9:28 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Tue, 11 Jun 2019 20:05:13 +0200
> Matteo Croce <mcroce@redhat.com> wrote:
>
> > Pass the -pipe option to GCC, to use pipes instead of temp files.
> > On a slow AMD G-T40E CPU we get a non negligible 6% improvement
> > in build time.
> >
> > real    1m15,111s
> > user    1m2,521s
> > sys     0m12,465s
> >
> > real    1m10,861s
> > user    1m2,520s
> > sys     0m12,901s
> >
> > Signed-off-by: Matteo Croce <mcroce@redhat.com>
>
> Why bother, on my machine (make -j12).
>
> Before
> real    0m6.320s
> user    0m30.674s
> sys     0m3.649s
>
>
> After (with -pipe)
> real    0m6.158s
> user    0m31.197s
> sys     0m3.532s
>
>
> So it is slower. Get a faster disk :-)
>

I did it :)

root@apu:~# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads: 1086 MB in  3.00 seconds = 361.58 MB/sec

No change at all thought. It's really a CPU bound job, and this
machine is not a number cruncher:

root@apu:~# dd if=/dev/zero bs=1G count=1 status=none |time -p sha1sum
2a492f15396a6768bcbca016993f4b4c8b0b5307  -
real 16.00
user 12.38
sys 2.05

I think that the slight increase is due to the fact that the processes
starts in parallel, instead of being serialized.

> Maybe allow "EXTRA_CFLAGS" to be passed to Makefile for those that
> have a burning need for this.

Just out of curiosity, I checked the linux history repo to discover
when it was introduced in the kernel, it tooks me a while to really
find it:

Linux-0.99.13k (September 19, 1993)

-- 
Matteo Croce
per aspera ad upstream

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-14 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 18:05 [PATCH iproute2-next] Makefile: pass -pipe to the compiler Matteo Croce
2019-06-11 19:28 ` Stephen Hemminger
2019-07-14 16:36   ` Matteo Croce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).