MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / main

Function main

test/perf/compiled_extensions/command.py:57–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def main():
58 import argparse
59
60 cases = Case._CASES
61
62 parser = argparse.ArgumentParser(
63 description="Compare implementation between them"
64 )
65 parser.add_argument(
66 "case",
67 help="Case to run",
68 nargs="+",
69 choices=["all"] + sorted(c.__name__ for c in cases),
70 )
71 parser.add_argument("--filter", help="filter the test for this regexp")
72 parser.add_argument(
73 "--factor", help="scale number passed to timeit", type=float, default=1
74 )
75 parser.add_argument("--csv", help="save to csv", action="store_true")
76 save_group = parser.add_argument_group("Save result for later compare")
77 save_group.add_argument(
78 "--save-db",
79 help="Name of the sqlite db file to use",
80 const="perf.db",
81 nargs="?",
82 )
83 save_group.add_argument(
84 "--save-name",
85 help="A name given to the current save. "
86 "Can be used later to compare against this run.",
87 )
88
89 compare_group = parser.add_argument_group("Compare against stored data")
90 compare_group.add_argument(
91 "--compare-db",
92 help="Name of the sqlite db file to read for the compare data",
93 const="perf.db",
94 nargs="?",
95 )
96 compare_group.add_argument(
97 "--compare-filter",
98 help="Filter the compare data using this string. Can include "
99 "git-short-sha, save-name previously used or date. By default the "
100 "latest values are used",
101 )
102
103 args = parser.parse_args()
104
105 to_run: list[type[Case]]
106 if "all" in args.case:
107 to_run = cases
108 else:
109 to_run = [c for c in cases if c.__name__ in args.case]
110
111 if args.save_db:
112 save_engine = sa.create_engine(
113 f"sqlite:///{args.save_db}", poolclass=sa.NullPool
114 )

Callers

nothing calls this directly

Calls 15

find_git_shaFunction · 0.85
sumClass · 0.85
tabulateFunction · 0.85
openFunction · 0.85
create_allMethod · 0.80
or_Method · 0.80
run_caseMethod · 0.80
order_byMethod · 0.45
whereMethod · 0.45
selectMethod · 0.45
descMethod · 0.45
icontainsMethod · 0.45

Tested by

no test coverage detected