[Patch, fortran] PR 25708 Reduce seeks when loading module files

Janne Blomqvist blomqvist.janne@gmail.com
Wed Nov 30 17:32:00 GMT 2011


Hi,

this patch expands a bit on the recent work done by Thomas Koenig.
Using aermod.f90 from the polyhedron benchmark suite as a test case,
the lseek() calls as reported by strace -c -f go roughly as

- trunk before Thomas' patch: 21 million

- current trunk: 5.7 million

- with attached patch: 2.7 million

As can be seen, this patch roughly halves the seeks. Of course, 2.7
million is still a ridiculously high number, but further work requires
different kind of changes, perhaps also a bit riskier, which is why
I'd like to get this in separately.

Regtested on x86_64-unknown-linux-gnu, Ok for trunk?

2011-11-30  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/25708
	* module.c (parse_string): Read string into resizable array
	instead of parsing twice and seeking.
	(verify_atoms): New function.
	(require_atom): Move checking to verify_atoms, call it.
	(mio_typespec): Don't peek.
	(mio_constructor): Likewise.
	(mio_typebound_proc): Likewise.
	(mio_full_typebound_tree): Likewise.
	(mio_f2k_derived): Likewise.
	(load_operator_interfaces): Likewise.
	(load_generic_interfaces): Likewise.
	(load_commons): Likewise.
	(load_equiv): Likewise.
	(load_derived_extensions): Likewise.
	(read_module): Likewise.


-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modseek1.diff
Type: text/x-patch
Size: 9743 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111130/233152b8/attachment.bin>


More information about the Fortran mailing list