On 2025-Nov-28, Peter Eisentraut wrote:

> Here is another patch set.  I have made some tweaks to address the issue you
> raise, and I took some code and inspiration from Thomas Munro's patch.  The
> solution I chose is to create a temporary subdirectory in the build
> directory, and create the test files in there.  That way the trap can just
> blow away the directory, as before.

I tried with all patches applied, and it seems to work okay -- the
header compiles are all cached after the first pass, according to
ccache --show-stats.

> Another approach I had in mind for some time is to just write out a makefile
> with the test compile commands, and run that with make -j. Demo patch
> attached.  (I'm not seriously proposing this.  For one thing, we probably
> wouldn't want to introduce a dependency on make.  But you could probably
> write an equivalent ninja.build file.)
> 
> But this doesn't seem to buy very much.  The overhead of the shell script to
> write out the test files appears to become significant compared the the
> actual compile commands.

Really?  I tried editing the make line to have -j8 (your patch doesn't
have a -j switch at all there) and it runs in 4s instead of 12s on my
laptop, which I would call a significant win.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
#error "Operator lives in the wrong universe"
  ("Use of cookies in real-time system development", M. Gleixner, M. Mc Guire)


Reply via email to