http://scons.tigris.org/issues/show_bug.cgi?id=2329
[scons.git] / timings / SCons_Bars.py
1 #
2 # __COPYRIGHT__
3 #
4 # Permission is hereby granted, free of charge, to any person obtaining
5 # a copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish,
8 # distribute, sublicense, and/or sell copies of the Software, and to
9 # permit persons to whom the Software is furnished to do so, subject to
10 # the following conditions:
11 #
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #
23
24 """
25 A quick module for central collection of information about which
26 Subversion revisions are important for performance implications.
27 """
28
29 class Bars(dict):
30     """
31     Dictionary subclass for mapping revision numbers to labels describing
32     each revision.
33
34     We provide two extensions:  a .color attribute (for the default
35     color) and a .gnuplot() method (for returning a list of revisions
36     in the tuple format that scons-time uses to describe vertical bars).
37     """
38     def __init__(self, dict=None, color=None, **kwargs):
39         super(Bars, self).__init__(dict, **kwargs)
40         self.color = color
41     def gnuplot(self, color=None, labels=False, revs=None):
42         if color is None:
43             color = self.color
44         if revs is None:
45             revs = sorted(self.keys())
46         if labels:
47             result = [ (r, color, None, self[r]) for r in revs ]
48         else:
49             result = [ (r, color, None, None) for r in revs ]
50         return tuple(result)
51
52 # The Release_Bars dictionary records the Subversion revisions that
53 # correspond to each official SCons release.
54
55 Release_Bars = Bars(
56     color = 7,
57     dict = {
58         1232 : '0.96.90', 
59         1344 : '0.96.91', 
60         1435 : '0.96.92', 
61         1674 : '0.96.93', 
62         1765 : '0.96.94', 
63         1835 : '0.96.95', 
64         1882 : '0.96.96', 
65         1901 : '0.97', 
66         2242 : '0.97.0d20070809', 
67         2454 : '0.97.0d20070918', 
68         2527 : '0.97.0d20071212', 
69     },
70 )
71
72
73 # The Revisions_Bars dictionary records the Subversion revisions that
74 # correspond to "interesting" changes in timing.  This is essentially the
75 # global list of interesting changes.  Individual timing configurations
76 # typically only display bars for a subset of these, the ones that
77 # actually affect their configuration.
78 #
79 # Note that the default behavior of most of the st.conf files is to
80 # *not* display the labels for each of these lines, since they're long
81 # and verbose.  So in practice they function as comments describing the
82 # changes that have timing impacts on various configurations.
83
84 Revision_Bars = Bars(
85     color = 5,
86     dict = {
87         1220 : 'Use WeakValueDicts in the Memoizer to reduce memory use.',
88         1224 : 'Don\'t create a Node for every file we try to find during scan.',
89         1231 : 'Don\'t pick same-named directories in a search path.',
90         1241 : 'Optimize out N*M suffix matching in Builder.py.',
91         1245 : 'Reduce gen_binfo() time for long source lists.',
92         1261 : 'Fix -j re-scanning built files for implicit deps.',
93         1262 : 'Match Entries when searching paths for Files or Dirs.',
94         1273 : 'Store paths in .sconsign relative to target directory.',
95         1282 : 'Cache result from rel_path().',
96         1307 : 'Move signature Node tranlation of rel_paths into the class.',
97         1346 : 'Give subst logic its own module.',
98         1349 : 'More efficient checking for on-disk file entries.',
99         1407 : 'Use a Dir scanner instead of a hard-coded method.',
100         1433 : 'Remove unnecessary creation of RCS and SCCS Node.Dir nodes.',
101         1435 : 'Don\'t convert .sconsign dependencies to Nodes until needed.',
102         1468 : 'Use waiting-Node reference counts to speed up Taskmaster.',
103         1477 : 'Delay disambiguation of Node.FS.Entry into File/Dir.',
104         1533 : 'Fix some disambiguation-delay ramifications.',
105         1655 : 'Reduce unnecessary calls to Node.FS.disambiguate().',
106         1703 : 'Lobotomize Memoizer.',
107         1706 : 'Fix _doLookup value-cache misspellings.',
108         1712 : 'PathList, restore caching of Builder source suffixes.',
109         1724 : 'Cache Node.FS.find_file() and Node.FS.Dir.srcdir_find_file().',
110         1727 : 'Cache Executor methods, reduce calls when scanning.',
111         1752 : 'Don\'t cache Builder source suffixes too early.',
112         1790 : 'Clean up various module imports (pychecker fixes).',
113         1794 : 'Un-fix various later-Python-version pychecker "fixes".',
114         1828 : 'Speed up Builder suffix-matching (SuffixMap).',
115         2380 : 'The Big Signature Refactoring hits branches/core.',
116     },
117 )
118
119 # Local Variables:
120 # tab-width:4
121 # indent-tabs-mode:nil
122 # End:
123 # vim: set expandtab tabstop=4 shiftwidth=4: