diff options
Diffstat (limited to 'timings')
-rw-r--r-- | timings/CPPPATH/SConstruct | 66 | ||||
-rw-r--r-- | timings/CPPPATH/st.conf | 44 | ||||
-rw-r--r-- | timings/JTimer/SConstruct | 54 | ||||
-rw-r--r-- | timings/JTimer/st.conf | 48 | ||||
-rw-r--r-- | timings/SCons_Bars.py | 118 | ||||
-rw-r--r-- | timings/hundred/SConstruct | 52 | ||||
-rw-r--r-- | timings/hundred/st.conf | 47 |
7 files changed, 429 insertions, 0 deletions
diff --git a/timings/CPPPATH/SConstruct b/timings/CPPPATH/SConstruct new file mode 100644 index 0000000..728db9c --- /dev/null +++ b/timings/CPPPATH/SConstruct @@ -0,0 +1,66 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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. +# + +""" +This configuration is for testing the timing of searching long lists of +CPPPATH directories. + +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) + +env = Environment(CPPPATH = inc_list) + +env.Object( 'foo.c' ) diff --git a/timings/CPPPATH/st.conf b/timings/CPPPATH/st.conf new file mode 100644 index 0000000..6507ea2 --- /dev/null +++ b/timings/CPPPATH/st.conf @@ -0,0 +1,44 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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. +""" + +archive_list = [ 'SConstruct' ] +subdir = '.' + +import sys +sys.path.insert(0, '..') +import SCons_Bars + +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. +] + +vertical_bars = SCons_Bars.Release_Bars.gnuplot(labels=True) + \ + SCons_Bars.Revision_Bars.gnuplot(labels=False, revs=revs) diff --git a/timings/JTimer/SConstruct b/timings/JTimer/SConstruct new file mode 100644 index 0000000..e1e38d2 --- /dev/null +++ b/timings/JTimer/SConstruct @@ -0,0 +1,54 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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. +# + +""" +This configuration is for timing how we evaluate long chains of +dependencies, specifically when -j is used. + +We set up a chain of 100 targets that get built from a Python function +action with no source files (equivalent to "echo junk > $TARGET"). +Each target explicitly depends on the next target in turn, so the +Taskmaster will do a deep walk of the dependency graph. + +This test case was contributed by Kevin Massey. Prior to revision 1468, +we had a serious O(N^2) problem in the Taskmaster when handling long +dependency chains like this. That was fixed by adding reference counts +to the Taskmaster so it could be smarter about not re-evaluating Nodes. +""" + +target_cnt = 100 + +env = Environment() + +def write_file( env, target, source ): + path_target = env.File( target ).path + outfile = open( path_target, 'w' ) + outfile.write( 'junk' ) + outfile.close() + +list = [] +for i in range( target_cnt ): + target = 'target_%03d' % i + env.Command( target, [], write_file ) + env.Depends( target, list ) + list.append( target ) diff --git a/timings/JTimer/st.conf b/timings/JTimer/st.conf new file mode 100644 index 0000000..cf1ecbf --- /dev/null +++ b/timings/JTimer/st.conf @@ -0,0 +1,48 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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 "JTimer" timing test. +""" + +archive_list = [ 'SConstruct' ] +subdir = '.' +targets = '-j2' + +import sys +sys.path.insert(0, '..') +import SCons_Bars + +revs = [ + 1261, # Fix -j re-scanning built files for implicit deps. + 1307, # Move signature Node tranlation of rel_paths into the class. + 1407, # Use a Dir scanner instead of a hard-coded method. + 1435, # Don't prep .sconsign dependencies until needed. + 1468, # Use waiting-Node reference counts to speed up Taskmaster. + 1703, # Lobotomize Memoizer. + 1706, # Fix _doLookup value-cache misspellings. + 2380, # The Big Signature Refactoring hits branches/core. +] + +vertical_bars = SCons_Bars.Release_Bars.gnuplot(labels=True) + \ + SCons_Bars.Revision_Bars.gnuplot(labels=False, revs=revs) diff --git a/timings/SCons_Bars.py b/timings/SCons_Bars.py new file mode 100644 index 0000000..c56fb36 --- /dev/null +++ b/timings/SCons_Bars.py @@ -0,0 +1,118 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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. +# + +""" +A quick module for central collection of information about which +Subversion revisions are important for performance implications. +""" + +class Bars(dict): + """ + Dictionary subclass for mapping revision numbers to labels describing + each revision. + + We provide two extensions: a .color attribute (for the default + color) and a .gnuplot() method (for returning a list of revisions + in the tuple format that scons-time uses to describe vertical bars). + """ + def __init__(self, dict=None, color=None, **kwargs): + super(Bars, self).__init__(dict, **kwargs) + self.color = color + def gnuplot(self, color=None, labels=False, revs=None): + if color is None: + color = self.color + if revs is None: + revs = self.keys() + revs.sort() + if labels: + result = [ (r, color, None, self[r]) for r in revs ] + else: + result = [ (r, color, None, None) for r in revs ] + return tuple(result) + +# The Release_Bars dictionary records the Subversion revisions that +# correspond to each official SCons release. + +Release_Bars = Bars( + color = 7, + dict = { + 1232 : '0.96.90', + 1344 : '0.96.91', + 1435 : '0.96.92', + 1674 : '0.96.93', + 1765 : '0.96.94', + 1835 : '0.96.95', + 1882 : '0.96.96', + 1901 : '0.97', + 2242 : '0.97.0d20070809', + 2454 : '0.97.0d20070918', + 2527 : '0.97.0d20071212', + }, +) + + +# The Revisions_Bars dictionary records the Subversion revisions that +# correspond to "interesting" changes in timing. This is essentially the +# global list of interesting changes. Individual timing configurations +# typically only display bars for a subset of these, the ones that +# actually affect their configuration. +# +# Note that the default behavior of most of the st.conf files is to +# *not* display the labels for each of these lines, since they're long +# and verbose. So in practice they function as comments describing the +# changes that have timing impacts on various configurations. + +Revision_Bars = Bars( + color = 5, + dict = { + 1220 : 'Use WeakValueDicts in the Memoizer to reduce memory use.', + 1224 : 'Don\'t create a Node for every file we try to find during scan.', + 1231 : 'Don\'t pick same-named directories in a search path.', + 1241 : 'Optimize out N*M suffix matching in Builder.py.', + 1245 : 'Reduce gen_binfo() time for long source lists.', + 1261 : 'Fix -j re-scanning built files for implicit deps.', + 1262 : 'Match Entries when searching paths for Files or Dirs.', + 1273 : 'Store paths in .sconsign relative to target directory.', + 1282 : 'Cache result from rel_path().', + 1307 : 'Move signature Node tranlation of rel_paths into the class.', + 1346 : 'Give subst logic its own module.', + 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.', + 1435 : 'Don\'t convert .sconsign dependencies to Nodes until needed.', + 1468 : 'Use waiting-Node reference counts to speed up Taskmaster.', + 1477 : 'Delay disambiguation of Node.FS.Entry into File/Dir.', + 1533 : 'Fix some disambiguation-delay ramifications.', + 1655 : 'Reduce unnecessary calls to Node.FS.disambiguate().', + 1703 : 'Lobotomize Memoizer.', + 1706 : 'Fix _doLookup value-cache misspellings.', + 1712 : 'PathList, restore caching of Builder source suffixes.', + 1724 : 'Cache Node.FS.find_file() and Node.FS.Dir.srcdir_find_file().', + 1727 : 'Cache Executor methods, reduce calls when scanning.', + 1752 : 'Don\'t cache Builder source suffixes too early.', + 1790 : 'Clean up various module imports (pychecker fixes).', + 1794 : 'Un-fix various later-Python-version pychecker "fixes".', + 1828 : 'Speed up Builder suffix-matching (SuffixMap).', + 2380 : 'The Big Signature Refactoring hits branches/core.', + }, +) diff --git a/timings/hundred/SConstruct b/timings/hundred/SConstruct new file mode 100644 index 0000000..2332d73 --- /dev/null +++ b/timings/hundred/SConstruct @@ -0,0 +1,52 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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. +# + +""" +This configuration is for timing how we handle the NxM interaction when +we build a lot of targets from a lot of source files. + +We create a list of 100 target files that will each be built by copying +a file from a corresponding list of 100 source files. The source +files themselves are each built by a Python function action that's the +equivalent of "echo contents > $TARGET". +""" + +target_cnt = 100 + +env = Environment() + +def create_file( env, target, source ): + t = str(target[0]) + open( t, 'w' ).write('contents\n') + +source_list = map(lambda t: 'source_%03d' % t, xrange(target_cnt)) +target_list = map(lambda t: 'target_%03d' % t, xrange(target_cnt)) + +for source in source_list: + env.Command( source, [], create_file ) + +def copy_files( env, target, source ): + for t, s in zip(target, source): + open(str(t), 'w').write(open(str(s), 'r').read()) + +env.Command( target_list, source_list, copy_files ) diff --git a/timings/hundred/st.conf b/timings/hundred/st.conf new file mode 100644 index 0000000..adfb09e --- /dev/null +++ b/timings/hundred/st.conf @@ -0,0 +1,47 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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 "hundred" timing test. +""" + +archive_list = [ 'SConstruct' ] +subdir = '.' + +import sys +sys.path.insert(0, '..') +import SCons_Bars + +revs = [ + 1220, # Use WeakValueDicts in the Memoizer to reduce memory use. + 1307, # Move signature Node tranlation of rel_paths into the class. + 1435, # Fix Debug.caller() directory separators. + 1477, # Delay disambiguation of Node.FS.Entry into File/Dir. + 1655, # Reduce unnecessary calls to Node.FS.disambiguate(). + 1703, # Lobotomize Memoizer. + 1727, # Cache Executor methods, reduce calls when scanning. + 2380, # The Big Signature Refactoring hits branches/core. +] + +vertical_bars = SCons_Bars.Release_Bars.gnuplot(labels=True) + \ + SCons_Bars.Revision_Bars.gnuplot(labels=False, revs=revs) |