Re: [PATCH 0/7] minmax: reduce compilation time

From: Linus Torvalds
Date: Tue Jul 30 2024 - 00:13:16 EST


On Sat, 27 Jul 2024 at 09:26, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Longest line is drivers/.../ia_css_ynr.host.c:71 (27785kB)

So that 27MB shrank to 23MB and then to "only" 1.4MB with the patches
that are now in mainline.

Now with the patch I just posted at

https://lore.kernel.org/all/CAHk-=wgRDupSBzUX_N_Qo_eaYyDfOH=VTihhikN36cGxCc+jvg@xxxxxxxxxxxxxx/

that nasty line expands to "just" 82kB, and the file builds quickly.

Still not exactly small, but hey, two and a half orders of magnitude isn't bad.

And yes, that one driver is disgusting and Lorenzo had a nice patch to
change some macros to inline functions which just made the whole
problem go away, but as a test-case for horrid macro expansion of
min()/max() it was lovely.

Of course, I never did any build timings. I'm not sure how much it
actually shows up on that level. A couple of bad cases won't be *that*
noticeable when most cases aren't too horrid.

Linus