We use VTK’s Python wrapper for VTK classes in 3D Slicer and we find that on Windows it can take several minutes to generate the hierarchy files for each larger library. If we change a header file at lower level, hierarchy generation can add 10 minutes to the build.
We have found that it is due to
stat() function is used to check if a header file can be found in an include directory - and at application level (where a library may depend on VTK, ITK, and a number of other libraries) there are hundreds of header files and hundreds of include folders.
We tested that by creating a list of all the files in all the include folders and checking the existence of a file by looking up paths in this list we can make vtkWrapHierarchy about 3-5x faster. See implementation here.
@dgobbi Would it be possible to add such caching in vtkWrapHierarchy on Windows? (or maybe on other plaforms, too, controllable with an environment variable or command-line option)