Subject: Re: bug#11935: XINT etc. should be functions

From: Paul Eggert <[email-masked]>
Date: Sat, 08 Jun 2013 17:52:05 -0700

On 06/06/13 09:42, Stefan Monnier wrote:

> Having XCONS and friends duplicated into a macro version and a function
> version is a non-starter for me.

Yes, I didn't like those macros either.  I'll remove them; they're no
longer needed now that GCC has the -Og option.  In case you haven't
run into it yet, -Og means "optimize for debugging", and causes GCC to
generate code that's easy to debug, without having the big runtime
performance penalty of -O0.

Like -O2 but unlike -O0, with -Og the CPU time for my little Lisp
nthcdr benchmark is unaffected by the proposed patch (assuming those
macros are removed).  C compilation time is considerably faster for
-Og than for -O2; it's not as fast as -O0, but for the common case of
changing one C source file and then typing "make emacs", -Og is faster
than -O0 (because bootstrap-emacs runs faster) and is a tad faster
than -O2 (because the C compiler runs faster).

Here are the detailed times, if you're curious.  I got these on a
Fedora 17 x86-64 (AMD Phenom II X4 910e) that was otherwise unloaded.
I used plain 'make' without parallelism.  Everything was built with
GCC 4.8.1 and with Texinfo 5.1.  All times are user+system CPU times;
the low-order digits of the times aren't that reliable.

		(benchmark  make \    rm fns.o;   rm *.o;    make \
		   100000)   xdisp.o  make emacs  make emacs  bootstrap
  -O0 unpatched    2.89        3.1       12.4        57	       1099
  -O0 patched     21.66        3.0       20.0        63        2442
  -Og unpatched    1.15        5.9        9.2        80	        860
  -Og patched      1.15        6.4        9.5        87	        879
  -O2 unpatched    1.57       11.3        9.6       110		843
  -O2 patched      1.57       11.1        9.9       119	        847

In (benchmark 100000) the -Og code runs faster than -O2, which is
surprising, but I think it's an anomaly; I may find the time to fire
off a performance bug-report to the GCC developers.