[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
non-recursive make: is there a performance gain?
From: |
Jim Meyering |
Subject: |
non-recursive make: is there a performance gain? |
Date: |
Sat, 08 Sep 2012 15:29:40 +0200 |
I've converted lib/ to non-recursive make, too, and thought it was time
to measure the performance change. For now, it's all in a single ugly
commit, so I'm not ready to share. I will tease it into at least a few
separate commits so that it's easier to review.
I didn't expect much improvement, since there are so few sub-directories
and so many compilations per directory. Bug, ... surprise! So far there
is *no* improvement, and in fact a small penalty in this very worst case:
=================================================
BEFORE: in tmpfs, coreutils-8.19, "make clean; env time make -j25" w/ccache
5.58user 2.52system 0:01.73elapsed 466%CPU (0avgtext+0avgdata 10872maxresident)k
0inputs+4712outputs (0major+828117minor)pagefaults 0swaps
5.51user 2.57system 0:01.75elapsed 462%CPU (0avgtext+0avgdata 10872maxresident)k
0inputs+4776outputs (0major+828531minor)pagefaults 0swaps
5.49user 2.48system 0:01.73elapsed 460%CPU (0avgtext+0avgdata 10868maxresident)k
0inputs+3584outputs (0major+816286minor)pagefaults 0swaps
5.49user 2.42system 0:01.73elapsed 456%CPU (0avgtext+0avgdata 10872maxresident)k
0inputs+3584outputs (0major+816347minor)pagefaults 0swaps
5.46user 2.50system 0:01.71elapsed 463%CPU (0avgtext+0avgdata 10872maxresident)k
0inputs+3584outputs (0major+816319minor)pagefaults 0swaps
=================================================
AFTER (non-recursive): coreutils-8.19.114-af17f-dirty: same conditions as above
5.80user 2.78system 0:01.98elapsed 432%CPU (0avgtext+0avgdata 13996maxresident)k
0inputs+3984outputs (0major+1047869minor)pagefaults 0swaps
5.84user 2.84system 0:01.98elapsed 436%CPU (0avgtext+0avgdata 14020maxresident)k
0inputs+3984outputs (0major+1047872minor)pagefaults 0swaps
5.82user 2.76system 0:01.97elapsed 435%CPU (0avgtext+0avgdata 14004maxresident)k
0inputs+3984outputs (0major+1047861minor)pagefaults 0swaps
5.88user 2.74system 0:01.96elapsed 440%CPU (0avgtext+0avgdata 14028maxresident)k
0inputs+3984outputs (0major+1047856minor)pagefaults 0swaps
Going from ~1.73 elapsed to 1.97 is a penalty of 15%.
An even less-flattering (but less realistic) case is the "nothing to do"
build, where the elapsed time goes from 0.83s to 1.03s. That's a 25%
performance hit.
One interesting metric is that the top level Makefile goes
from 2300 lines to 9965, and the total Makefile line count goes
from 30k to 17k:
BEFORE$ wc -l */Makefile Makefile
2245 doc/Makefile
8064 gnulib-tests/Makefile
4809 lib/Makefile
2070 man/Makefile
692 po/Makefile
3493 src/Makefile
6356 tests/Makefile
2299 Makefile
30028 total
AFTER$ wc -l */Makefile Makefile
6509 gnulib-tests/Makefile
692 po/Makefile
9965 Makefile
17166 total
In spite of this nominal performance penalty (it's barely visible
when using a real disk rather than a tmpfs partition),
I'm still enthusiastic about converting to non-recursive builds.
- non-recursive make: is there a performance gain?,
Jim Meyering <=
- Re: non-recursive make: is there a performance gain?, Stefano Lattarini, 2012/09/08
- Re: non-recursive make: is there a performance gain?, Jim Meyering, 2012/09/08
- Re: non-recursive make: is there a performance gain?, Stefano Lattarini, 2012/09/08
- Re: non-recursive make: is there a performance gain?, Jim Meyering, 2012/09/08
- Re: non-recursive make: is there a performance gain?, Jim Meyering, 2012/09/08
- Re: non-recursive make: is there a performance gain?, Jim Meyering, 2012/09/08
- Re: non-recursive make: is there a performance gain?, Stefano Lattarini, 2012/09/08