0

I was using

strace -eopen -f g++ ...

in order to see what is happening. I found the number of calls to open() were 13244 with 10880 failing. So I looked at the output and looked at one particular file from boost (noncopyable.hpp) and found that the number of calls to open this file was 18 with the last succeeding.

What are some methods for reducing this?

And yes -- this was supposed to be using precompiled headers and the matching generated file is being opened (.gch).

BTW -- the number of usages of the -I option is 3.

Frank Puck
  • 467
  • 1
  • 11
  • 1
    Where are all the failing opens looking? I guess there's a long list of directories that it searches for include files. – Barmar Mar 01 '23 at 23:13

1 Answers1

0

One can use the alternative option

-iquote directory

instead of

-I directory

The former applies only to include statements with the filename in double quotes. This reduced the number of failed attempts to find include files from boost dramatically.

Frank Puck
  • 467
  • 1
  • 11
  • Out of curiosity, what kind of speedup in compile time did you achieve? – Friedrich Mar 16 '23 at 14:28
  • 1
    @Friedrich The compile time performance improvement was not measurable. I attribute this to usage of a NFS filesystem for g++, boost, and various include files. It is a one .cpp file build of generated code at the customer site. I tried to use the same for our actually software build, but cmake does not allow for it. (I anyway do not understand the point of makefiles generating makefiles). – Frank Puck Mar 17 '23 at 16:08