99 * Create a temp clone of the mypy repo for each target commit to measure
1010 * Checkout a target commit in each of the clones
1111 * Compile mypyc in each of the clones *in parallel*
12- * Create another temp clone of the mypy repo as the code to check
12+ * Create another temp clone of the first provided revision (or, with -r, a foreign repo) as the code to check
1313 * Self check with each of the compiled mypys N times
1414 * Report the average runtimes and relative performance
1515 * Remove the temp clones
@@ -100,6 +100,8 @@ def run_benchmark(
100100def main () -> None :
101101 whole_program_time_0 = time .time ()
102102 parser = argparse .ArgumentParser (
103+ formatter_class = argparse .RawDescriptionHelpFormatter ,
104+ description = __doc__ ,
103105 epilog = "Remember: you usually want the first argument to this command to be 'master'."
104106 )
105107 parser .add_argument (
@@ -112,7 +114,8 @@ def main() -> None:
112114 "--dont-setup" ,
113115 default = False ,
114116 action = "store_true" ,
115- help = "don't make the dirs or compile mypy, just run the performance measurement benchmark" ,
117+ help = "don't make the clones or compile mypy, just run the performance measurement benchmark "
118+ + "(this will fail unless the clones already exist, such as from a previous run that was canceled before it deleted them)" ,
116119 )
117120 parser .add_argument (
118121 "--num-runs" ,
@@ -133,8 +136,9 @@ def main() -> None:
133136 metavar = "FOREIGN_REPOSITORY" ,
134137 default = None ,
135138 type = str ,
136- help = "measure time to type check the project at FOREIGN_REPOSITORY instead of mypy self-check; "
137- + "provided value must be the URL or path of a git repo" ,
139+ help = "measure time to typecheck the project at FOREIGN_REPOSITORY instead of mypy self-check; "
140+ + "the provided value must be the URL or path of a git repo "
141+ + "(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)" ,
138142 )
139143 parser .add_argument (
140144 "-c" ,
@@ -143,7 +147,7 @@ def main() -> None:
143147 type = str ,
144148 help = "measure time to type check Python code fragment instead of mypy self-check" ,
145149 )
146- parser .add_argument ("commit" , nargs = "+" , help = "git revision to measure ( e.g. branch name) " )
150+ parser .add_argument ("commit" , nargs = "+" , help = "git revision(s), e.g. branch name or commit id, to measure the performance of " )
147151 args = parser .parse_args ()
148152 incremental : bool = args .incremental
149153 dont_setup : bool = args .dont_setup
0 commit comments