performance of m4-1.9a (was: popdef(undefined), __m4_version__)

Ralf Wildenhues <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Organization Department of Numerical Simulation, University of Bonn
Message-ID <[email protected]>
Hello again, and apologies for breaking the threading,

Ralf Wildenhues writes:
> Eric Blake writes:
> > 
> > ~   autoconf 2.62.45-65ff0  +[a]    +[b]    +[a] and [b]
> > m4-1.4.11           20.171  19.858  20.858  19.357
> > patched branch-1.6  21.294  20.154  22.202  20.250
> > argv_ref branch             19.013  17.750  19.219  17.266
> > master branch               29.966  28.948  32.417  27.904
> > 
> > The differences in base compile times are due somewhat to differing
> > compiler options, but it is also a bit depressing that the master branch
> > is 50% slower than 1.6.  Someday I'd like to profile that, and figure out
> > why the discrepancy.
> 
> Position-independent code.  I haven't measured, but would bet on it.

I've done a wee bit of measuring now.  Time for running autoconf in OpenMPI
is 15s with branch-1_4 and branch-1.6, 27s with master, and 23s when master
is configured --disable-shared.

Then, a gprof comparison between 1.6 and master shows that a significant other
part of the slowdown is due to the fact that master has to do an indirect
function call to for every character in next_char.  Can't the module interface
use larger boundaries than character for its interface, like reading a whole
token or so?  I mean, we're talking about roughly 140M function calls here.

Then, I saw that debug stuff like m4_set_current_{file,line} was called veeery
often (more than once per character).  Rebuilding optimized with -DNDEBUG got
master to 18s (with --disable-shared).

The gprof output files seem to indicate that next_char is called much more
often m4__next_token in master than next_char_1 is from next_token in
branch-1.6. However, gcov output does not confirm this, so I guess this is
an artifact from finite sampling density (and the amount that next_char_1
is faster) or inlining artifacts.

All tests done with -O2 -g.

Cheers,
Ralf

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
profile-m4-branch-1.6.gz (application/x-gunzip, 20.6 KB) - not displayed
profile-m4-master-nonshared.gz (application/x-gunzip, 33.3 KB) - not displayed
profile-m4-master-nonshared-NDEBUG.gz (application/x-gunzip, 27.6 KB) - not displayed
input.c.gcov.gz (application/x-gunzip, 24 KB) - not displayed
input.c.gcov.gz (application/x-gunzip, 22.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.