diff options
author | kamal@whence.com <kamal@whence.com@01de4be4-8c4a-0410-9132-4925637da917> | 2012-04-20 16:05:55 +0000 |
---|---|---|
committer | kamal@whence.com <kamal@whence.com@01de4be4-8c4a-0410-9132-4925637da917> | 2012-04-20 16:05:55 +0000 |
commit | f7a991a54cc041bf0e71697f1987ab4fb46ca7da (patch) | |
tree | f24a2eef3d7d0069bb968c488a0d8ffaea6a6f5a | |
parent | 17bdb296f31a8ecc1baee45a5d98814d774b207f (diff) | |
download | distcc-f7a991a54cc041bf0e71697f1987ab4fb46ca7da.tar.gz |
Fix issue 108 <http://code.google.com/p/distcc/issues/detail?id=108>:
include_server --no_force_dirs inhibits forcing_technique
The "forcing_technique" trick which handles the (rare) case of files
included as e.g. <foo/../file.h> causes a performance degradation:
The forcing files accumulate over the life of the include_server, making
distcc send more and more (useless) files as the build progresses.
While the forcing files are zero-length, the transmission filenames
themselves introduce a significant overhead for builds with many files
and directories.
This patch implements the include_server arg --no_force_dirs, which if
set switches off the "forcing_technique" scheme.
git-svn-id: http://distcc.googlecode.com/svn/trunk@767 01de4be4-8c4a-0410-9132-4925637da917
-rwxr-xr-x | include_server/basics.py | 1 | ||||
-rwxr-xr-x | include_server/include_analyzer.py | 7 | ||||
-rwxr-xr-x | include_server/include_server.py | 9 | ||||
-rw-r--r-- | man/include_server.1 | 7 |
4 files changed, 22 insertions, 2 deletions
diff --git a/include_server/basics.py b/include_server/basics.py index 0854aa5..f2c5301 100755 --- a/include_server/basics.py +++ b/include_server/basics.py @@ -220,6 +220,7 @@ opt_simple_algorithm = False opt_stat_reset_triggers = {} opt_statistics = False opt_unsafe_absolute_includes = False +opt_no_force_dirs = False opt_verify = False # whether to compare calculated include closure to that # produced by compiler opt_write_include_closure = False # write include closures to file diff --git a/include_server/include_analyzer.py b/include_server/include_analyzer.py index 576fa17..2c0fa5c 100755 --- a/include_server/include_analyzer.py +++ b/include_server/include_analyzer.py @@ -271,9 +271,12 @@ class IncludeAnalyzer(object): links = self.compiler_defaults.system_links + self.mirror_path.Links() files = self.compress_files.Compress(include_closure, client_root_keeper) - forcing_files = self._ForceDirectoriesToExist() + files_and_links = files + links - files_and_links = files + links + forcing_files + # Note that the performance degradation comment above applies especially + # to forced include directories, unless disabled with --no_force_dirs + if basics.opt_no_force_dirs == False: + files_and_links += self._ForceDirectoriesToExist() realpath_map = self.realpath_map diff --git a/include_server/include_server.py b/include_server/include_server.py index b7aa0d8..886baac 100755 --- a/include_server/include_server.py +++ b/include_server/include_server.py @@ -116,6 +116,12 @@ OPTIONS: gathering the include closure. See the include_server(1) man page for futher information. Using this option may lead to incorrect results. + + --no_force_dirs Do not force the creation of all directories used + in an include path. May improve peformance for + some cases, but will break builds which use + include structures like "<foo/../file.h>" without + including other files in foo/. -v, --verify Verify that files in CPP closure are contained in closure calculated by include processor. @@ -482,6 +488,7 @@ def _ParseCommandLineOptions(): "statistics", "time", "unsafe_absolute_includes", + "no_force_dirs", "verify", "write_include_closure"]) except getopt.GetoptError: @@ -517,6 +524,8 @@ def _ParseCommandLineOptions(): sys.exit("Not implemented") if opt in ("--unsafe_absolute_includes",): basics.opt_unsafe_absolute_includes = True + if opt in ("--no_force_dirs",): + basics.opt_no_force_dirs = True if opt in ("-s", "--statistics"): basics.opt_statistics = True if opt in ("-t", "--time"): diff --git a/man/include_server.1 b/man/include_server.1 index f462f89..2db9e5d 100644 --- a/man/include_server.1 +++ b/man/include_server.1 @@ -109,6 +109,13 @@ of existence of the header file is moot and the remote compilation is sound. This is often the case if such includes are meant for unusual configurations different from the actual configuration. .TP +.B --no_force_dirs +Do not force the creation of all directories used +in an include path. May improve peformance for +some cases, but will break builds which use +include structures like "<foo/../file.h>" without +including other files in foo/. +.TP .B -v, --verify Verify that files in CPP closure are contained in closure calculated by include processor. |