Subject: Re: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?

From: Paul Eggert <[email-masked]>
Date: Sun, 5 Jul 2020 16:57:40 -0700

On 7/5/20 3:03 AM, Andrea Corallo wrote:
> Wow I'm really surprised by this result!  Are we doing so much floating
> point while compiling Emacs?

No, and you are right to be skeptical. I checked again, and unfortunately I
originally measured the performance incorrectly, as I used a script that I had
forgotten adds '-march=native' which makes the benchmark results not reflect
what distros normally do (unless one is assuming something like Gentoo which is
far less common).

When I removed -march=native and stuck with just CC='gcc -m32' versus CC='gcc
-m32 -msse2 -mfpmath=sse', the performance difference went the other way on my
AMD Phenom II X4 910e (2010): the version generated with -msse2 -mfpmath=sse was
3.7% slower on the 'make compile-always' benchmark.

I suppose it's possible both of these numbers are artifacts, though I don't know
what would cause the artifacts. At any rate obviously I was wrong to suggest
that -msse2 improves performance on this benchmark. Sorry about the noise.

On 7/5/20 8:07 AM, Stefan Monnier wrote:
> Could it be that your measurements also included the time spent
> compiling C files and that GCC is significantly faster at generating
> code for SSE2?

I do a plain 'make' before running 'cd lisp; make compile-always' so GCC is not
involved; it's mostly an Emacs byte-compiler benchmark.