MCPcopy Index your code
hub / github.com/python/mypy / main

Function main

misc/perf_compare.py:115–269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114
115def main() -> None:
116 whole_program_time_0 = time.time()
117 parser = argparse.ArgumentParser(
118 formatter_class=argparse.RawDescriptionHelpFormatter,
119 description=__doc__,
120 epilog="Remember: you usually want the first argument to this command to be 'master'.",
121 )
122 parser.add_argument(
123 "--incremental",
124 default=False,
125 action="store_true",
126 help="measure incremental run (fully cached)",
127 )
128 parser.add_argument(
129 "--multi-file",
130 default=False,
131 action="store_true",
132 help="compile each mypy module to a separate C file (reduces RAM use)",
133 )
134 parser.add_argument(
135 "--dont-setup",
136 default=False,
137 action="store_true",
138 help="don't make the clones or compile mypy, just run the performance measurement benchmark "
139 + "(this will fail unless the clones already exist, such as from a previous run that was canceled before it deleted them)",
140 )
141 parser.add_argument(
142 "--num-runs",
143 metavar="N",
144 default=15,
145 type=int,
146 help="set number of measurements to perform (default=15)",
147 )
148 parser.add_argument(
149 "-j",
150 metavar="N",
151 default=4,
152 type=int,
153 help="set maximum number of parallel builds (default=4) -- high numbers require a lot of RAM!",
154 )
155 parser.add_argument(
156 "-r",
157 metavar="FOREIGN_REPOSITORY",
158 default=None,
159 type=str,
160 help="measure time to typecheck the project at FOREIGN_REPOSITORY instead of mypy self-check; "
161 + "the provided value must be the URL or path of a git repo "
162 + "(note that this script will take no special steps to *install* the foreign repo, so you will probably get a lot of missing import errors)",
163 )
164 parser.add_argument(
165 "-c",
166 metavar="CODE",
167 default=None,
168 type=str,
169 help="measure time to type check Python code fragment instead of mypy self-check",
170 )
171 parser.add_argument(
172 "commit",

Callers 1

perf_compare.pyFile · 0.70

Calls 15

enumerateFunction · 0.85
cloneFunction · 0.85
printFunction · 0.85
lenFunction · 0.85
rangeClass · 0.85
listClass · 0.85
run_benchmarkFunction · 0.85
boolClass · 0.85
intClass · 0.85
add_argumentMethod · 0.80
exitMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…