820d3ce627f8170d4e6f066e337c02832c6bbb35
[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 = self.keys()
46             revs.sort()
47         if labels:
48             result = [ (r, color, None, self[r]) for r in revs ]
49         else:
50             result = [ (r, color, None, None) for r in revs ]
51         return tuple(result)
52
53 # The Release_Bars dictionary records the Subversion revisions that
54 # correspond to each official SCons release.
55
56 Release_Bars = Bars(
57     color = 7,
58     dict = {
59         1232 : '0.96.90', 
60         1344 : '0.96.91', 
61         1435 : '0.96.92', 
62         1674 : '0.96.93', 
63         1765 : '0.96.94', 
64         1835 : '0.96.95', 
65         1882 : '0.96.96', 
66         1901 : '0.97', 
67         2242 : '0.97.0d20070809', 
68         2454 : '0.97.0d20070918', 
69         2527 : '0.97.0d20071212', 
70     },
71 )
72
73
74 # The Revisions_Bars dictionary records the Subversion revisions that
75 # correspond to "interesting" changes in timing.  This is essentially the
76 # global list of interesting changes.  Individual timing configurations
77 # typically only display bars for a subset of these, the ones that
78 # actually affect their configuration.
79 #
80 # Note that the default behavior of most of the st.conf files is to
81 # *not* display the labels for each of these lines, since they're long
82 # and verbose.  So in practice they function as comments describing the
83 # changes that have timing impacts on various configurations.
84
85 Revision_Bars = Bars(
86     color = 5,
87     dict = {
88         1220 : 'Use WeakValueDicts in the Memoizer to reduce memory use.',
89         1224 : 'Don\'t create a Node for every file we try to find during scan.',
90         1231 : 'Don\'t pick same-named directories in a search path.',
91         1241 : 'Optimize out N*M suffix matching in Builder.py.',
92         1245 : 'Reduce gen_binfo() time for long source lists.',
93         1261 : 'Fix -j re-scanning built files for implicit deps.',
94         1262 : 'Match Entries when searching paths for Files or Dirs.',
95         1273 : 'Store paths in .sconsign relative to target directory.',
96         1282 : 'Cache result from rel_path().',
97         1307 : 'Move signature Node tranlation of rel_paths into the class.',
98         1346 : 'Give subst logic its own module.',
99         1349 : 'More efficient checking for on-disk file entries.',
100         1407 : 'Use a Dir scanner instead of a hard-coded method.',
101         1433 : 'Remove unnecessary creation of RCS and SCCS Node.Dir nodes.',
102         1435 : 'Don\'t convert .sconsign dependencies to Nodes until needed.',
103         1468 : 'Use waiting-Node reference counts to speed up Taskmaster.',
104         1477 : 'Delay disambiguation of Node.FS.Entry into File/Dir.',
105         1533 : 'Fix some disambiguation-delay ramifications.',
106         1655 : 'Reduce unnecessary calls to Node.FS.disambiguate().',
107         1703 : 'Lobotomize Memoizer.',
108         1706 : 'Fix _doLookup value-cache misspellings.',
109         1712 : 'PathList, restore caching of Builder source suffixes.',
110         1724 : 'Cache Node.FS.find_file() and Node.FS.Dir.srcdir_find_file().',
111         1727 : 'Cache Executor methods, reduce calls when scanning.',
112         1752 : 'Don\'t cache Builder source suffixes too early.',
113         1790 : 'Clean up various module imports (pychecker fixes).',
114         1794 : 'Un-fix various later-Python-version pychecker "fixes".',
115         1828 : 'Speed up Builder suffix-matching (SuffixMap).',
116         2380 : 'The Big Signature Refactoring hits branches/core.',
117     },
118 )
119
120 # Local Variables:
121 # tab-width:4
122 # indent-tabs-mode:nil
123 # End:
124 # vim: set expandtab tabstop=4 shiftwidth=4: