diff options
Diffstat (limited to 'timings/CPPPATH')
-rw-r--r-- | timings/CPPPATH/SConstruct | 41 | ||||
-rw-r--r-- | timings/CPPPATH/TimeSCons-run.py (renamed from timings/CPPPATH/st.conf) | 32 | ||||
-rw-r--r-- | timings/CPPPATH/foo.c | 6 | ||||
-rw-r--r-- | timings/CPPPATH/include/foo.h | 1 |
4 files changed, 26 insertions, 54 deletions
diff --git a/timings/CPPPATH/SConstruct b/timings/CPPPATH/SConstruct index 728db9c..d49e3d6 100644 --- a/timings/CPPPATH/SConstruct +++ b/timings/CPPPATH/SConstruct @@ -21,45 +21,10 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -""" -This configuration is for testing the timing of searching long lists of -CPPPATH directories. +dir_count = int(ARGUMENTS['DIR_COUNT']) -We create 100 on-disk directories, with a single .h file in the last -directory in the list. We set CPPPATH to a list of Dir Nodes for the -created directories. The .c file we create #includes the .h file to be -found in the last directory in the list. -""" - -import os -import os.path - -dir_cnt = 100 - -dir_list = map(lambda t: 'inc_%03d' % t, xrange(dir_cnt)) - -for dir in dir_list: - if not os.path.isdir(dir): - os.mkdir(dir) - -foo_h = 'inc_099/foo.h' - -if not os.path.isfile(foo_h): - open(foo_h, 'w').write('#define FOO 1\n') - -contents = """\ -#include "foo.h" -void -foo(void) -{ - ; -} -""" - -if not os.path.isfile('foo.c'): - open('foo.c', 'w').write(contents) - -inc_list = map(lambda d: Dir(d), dir_list) +inc_list = [ Dir('inc_%04d' % t) for t in xrange(dir_count) ] +inc_list.append(Dir('include')) env = Environment(CPPPATH = inc_list) diff --git a/timings/CPPPATH/st.conf b/timings/CPPPATH/TimeSCons-run.py index 6507ea2..d88042e 100644 --- a/timings/CPPPATH/st.conf +++ b/timings/CPPPATH/TimeSCons-run.py @@ -19,26 +19,26 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# """ -scons-time.py configuration file for the "CPPPATH" timing test. +This configuration times searching long lists of CPPPATH directories. + +We create 5000 on-disk directories. A single checked-in .h file exists +in the 'include' directory. The SConstruct sets CPPPATH to a list of Dir +Nodes for the created directories, followed by 'include'. A checked-in .c +file #includes the .h file to be found in the last directory in the list. """ -archive_list = [ 'SConstruct' ] -subdir = '.' +import TestSCons + +test = TestSCons.TimeSCons() + +dir_count = 5000 -import sys -sys.path.insert(0, '..') -import SCons_Bars +for d in xrange(dir_count): + test.subdir('inc_%04d' % d) -revs = [ - 1224, # Don't create a Node for every file we try to find during scan. - 1349, # More efficient checking for on-disk file entries. - 1407, # Use a Dir scanner instead of a hard-coded method. - 1433, # Remove unnecessary creation of RCS and SCCS Node.Dir nodes. - 1703, # Lobotomize Memoizer. - 2380, # The Big Signature Refactoring hits branches/core. -] +test.main(options='DIR_COUNT=%s' % dir_count) -vertical_bars = SCons_Bars.Release_Bars.gnuplot(labels=True) + \ - SCons_Bars.Revision_Bars.gnuplot(labels=False, revs=revs) +test.pass_test() diff --git a/timings/CPPPATH/foo.c b/timings/CPPPATH/foo.c new file mode 100644 index 0000000..3cbb036 --- /dev/null +++ b/timings/CPPPATH/foo.c @@ -0,0 +1,6 @@ +#include "foo.h" +void +foo(void) +{ + ; +} diff --git a/timings/CPPPATH/include/foo.h b/timings/CPPPATH/include/foo.h new file mode 100644 index 0000000..b1e1311 --- /dev/null +++ b/timings/CPPPATH/include/foo.h @@ -0,0 +1 @@ +#define FOO 1 |