3 # Functions and data for timing different idioms for fetching a keyword
4 # value from a pair of dictionaries for localand global values. This was
5 # used to select how to most efficiently expand single $KEYWORD strings
6 # in src/engine/SCons/Subst.py.
8 def Func1(var
, gvars
, lvars
):
9 """lvars try:-except:, gvars try:-except:"""
10 for i
in IterationList
:
19 def Func2(var
, gvars
, lvars
):
20 """lvars has_key(), gvars try:-except:"""
21 for i
in IterationList
:
30 def Func3(var
, gvars
, lvars
):
31 """lvars has_key(), gvars has_key()"""
32 for i
in IterationList
:
40 def Func4(var
, gvars
, lvars
):
42 for i
in IterationList
:
44 x
= eval(var
, gvars
, lvars
)
48 def Func5(var
, gvars
, lvars
):
49 """Chained get with default values"""
50 for i
in IterationList
:
51 x
= lvars
.get(var
,gvars
.get(var
,''))
54 # Data to pass to the functions on each run. Each entry is a
55 # three-element tuple:
58 # "Label to print describing this data run",
59 # ('positional', 'arguments'),
60 # {'keyword' : 'arguments'},
65 "Neither in gvars or lvars",
70 "Missing from lvars, found in gvars",
76 ('x', {'x':1}, {'x':2}),
83 # indent-tabs-mode:nil
85 # vim: set expandtab tabstop=4 shiftwidth=4: