summaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-04-13 03:16:33 +0000
committerPaul Smith <psmith@gnu.org>2005-04-13 03:16:33 +0000
commit49ee105c685cb84bc3057e8b7666fc0cc7090047 (patch)
tree178eec81c5e39f56db9ca4b513376b3e1c5d35bf /ChangeLog
parent3daf8df6ee835b9edcc068af33ae97910bb8d934 (diff)
downloadgunmake-49ee105c685cb84bc3057e8b7666fc0cc7090047.tar.gz
Fix performance degradation introduced by the second expansion feature.
I did this by adding intelligence into the algorithm such that the second expansion was only actually performed when the prerequisite list contained at least one "$", so we knew it is actually needed. Without this we were using up a LOT more memory, since every single target (even ones never used by make) had their file variables initialized. This also used a lot more CPU, since we needed to create and populate a new variable hash table for every target. There is one issue remaining with this feature: it leaks memory. In pattern_search() we now initialize the file variables for every pattern target, which allocates a hash table, etc. However, sometimes we recursively invoke pattern_search() (for intermediate files) with an automatic variable (alloca() I believe) as the file. When that function returns, obviously, the file variable hash memory is lost.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog27
1 files changed, 27 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 03cb071..4d443eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2005-04-12 Paul D. Smith <psmith@gnu.org>
+
+ The second expansion feature causes significant slowdown. Timing
+ a complex makefile (GCC 4.1) shows a slowdown from .25s to just
+ read the makefile before the feature, to 11+s to do the same
+ operations after the feature. Additionally, memory usage
+ increased drastically. To fix this I added some intelligence that
+ avoids the overhead of the second expansion unless it's required.
+
+ * dep.h: Add a new boolean field, need_2nd_expansion.
+
+ * read.c (eval): When creating the struct dep for the target,
+ check if the name contains a "$"; if so set need_2nd_expansion to 1.
+ (record_files): If there's a "%" in a static pattern rule, it gets
+ converted to "$*" so set need_2nd_expansion to 1.
+
+ * file.c (expand_deps): Rework to be more efficient. Only perform
+ initialize_file_variables(), set_file_variables(), and
+ variable_expand_for_file() if the need_2nd_expansion is set.
+
+ * implicit.c (pattern_search): Default need_2nd_expansion to 0.
+ (pattern_search): Ditto.
+ * main.c (handle_non_switch_argument): Ditto.
+ (main): Ditto.
+ * read.c (read_all_makefiles): Ditto.
+ (eval_makefile): Ditto.
+
2005-04-07 Paul D. Smith <psmith@gnu.org>
* main.c (main) [WINDOWS32]: Export PATH to sub-shells, not Path.