From db023ae4e08addc0b533d9797049ab24c884d299 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 1 Oct 2004 14:59:14 +0000 Subject: [PATCH] * build/generators.jam: (select-alternative): Use string comparison of virtual targets, not the deep one with the 'str' method. The latter is very slow * tools/gcc.jam: Don't declare gcc.link and gcc.link.dll generators, as they are already inherited from unix.jam. If we declare them, then for each targets, the whole generation process is run twice. As result, select-alternative is called for each target, and due to sloweness of 'str' the performance is horrible. The net result is that running time on one testcase is down from 1580 secs to less than 10. [SVN r25512] --- src/build/generators.jam | 15 +++++++++++++-- src/tools/gcc.jam | 8 -------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index 5214d3551..b387a300b 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -590,8 +590,13 @@ rule register ( g ) } # Update the set of generators for toolset + + # TODO: should we check that generator with this id + # is not already registered. For example, the fop.jam + # module intentionally declared two generators with the + # same id, so such check will break it. local id = [ $(g).id ] ; - + # Some generators have multiple periods in their name, so the # normal $(id:S=) won't generate the right toolset name. # e.g. if id = gcc.compile.c++, then @@ -885,11 +890,17 @@ local rule select-dependency-graph ( options ) generators.dout $(r) ; } + # One note why we can compare object names directly, + # without using deep copy. All the targets here are + # produced by some generators, and generators should + # pass the targets they've returned via 'virtual-target.register'. + # So, two elements can only be equivalent, if they are just + # the same object. local f = [ $(options).at 1 ] ; local mismatch ; for local r in [ $(results).get ] { - if ! [ utility.equal $(r) $(f) ] + if [ $(r).get ] != [ $(f).get ] { mismatch = true ; } diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 7a59202f7..67d67a2bd 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -155,14 +155,6 @@ class gcc-linking-generator : unix-linking-generator } } -generators.register [ new gcc-linking-generator gcc.link : LIB OBJ : EXE - : gcc ] ; - -generators.register [ new gcc-linking-generator gcc.link.dll : LIB OBJ : SHARED_LIB - : gcc ] ; - - - # Declare flags and action for linking flags gcc.link OPTIONS on : -g ;