This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] libjava: faster 'make install'


There's quite a bit of unnecessary overhead of 'make install' in
libjava.  Two improvements:

1) Avoid one shell fork per file in write_entries_to_file, instead
use 4 forks per 50 files, plus some constant overhead.
Timings for `make install' in libjava on a GNU/Linux x86:
Pre: 155s, post: 120s.  (This should marginally benefit creation of
lib-gnu-awt-xlib.la as well.)

2) Use awk, and use `install' with multiple files at once.
Both of these uses are sanctioned by the GNU Coding Standards now.
However, it needs a fixed AC_PROG_INSTALL from Autoconf mainline,
to ensure that the `install' program is powerful enough.
Pre: 120s, post: 44s.  With both patches, `make install-data-local'
takes less than 10s, from 130s previously.


The two separate (and independent) limitations to 50 files are
- expected to suffice to stay below command line limits for any system
  (with `../gcc/configure', the longest line I measured has roughly
  3600 bytes),
- but still be only a few percent off the optimal speed on modern
  systems,
- in the second patch, avoid quadratic scaling due to shell string
  concatenation.

This patch should be pretty portable (I'm adding stuff similar to the
second patch into Automake[1]).  

For testing the first patch, I have verified that
  cd $host/libjava
  make write-entries-to-file-check

produces an identical libgcj.objectlist file; for both patches, I have
verified that, on i686-unknown-linux-gnu,
  make install

produces an identical installed image (apart from the inevitable
timestamp differences in produced static libraries and binary programs).

Both patches are shown without the (mechanical) changes to the
regenerated files.

OK for mainline?  I suppose some more testing would not hurt, but I
don't have access to a system with a really low command line length
limit.  If approved I can provide a patch to sync src.

Thanks,
Ralf

PS: Of course, libstdc++/include/Makefile.am (and maybe others) would
benefit from a similar patch as the second one (which I intend to submit
if this approach is deemed desirable).

[1] <http://thread.gmane.org/gmane.comp.sysutils.automake.patches/2945/focus=3088>

First patch:

libjava/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.am (write_entries_to_file_split): New variable.
	(write_entries_to_file): Write out that many entries at once,
	for speed.
	* Makefile.in: Regenerate.


Second patch:

ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* configure.ac: m4_include config/proginstall.m4.
	* configure: Regenerate.

config/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* proginstall.m4: New file, with fixed AC_PROG_INSTALL.

libjava/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.am (install-data-local): Rewrite to be more efficient,
	using awk, and `install' with multiple files at once.  Do not gather
	more than 50 files in one go to avoid hitting command line limits.
	(install_data_local_split): New variable.
	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* gcj/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

boehm-gc/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.

libffi/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

libgfortran/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.

libgomp/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

libmudflap/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

libssp/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.

libstdc++-v3/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* doc/Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

zlib/ChangeLog:
2008-03-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* aclocal.m4: Regenerate.
	* configure: Likewise.
	* Makefile.in: Likewise.

Attachment: p1
Description: Text document

Attachment: p2
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]