Skip to content

Commit 8816616

Browse files
committed
windows: limit PGO tests to a subset
Python 3.8 now runs a subset of tests during PGO instrumentation. This allows PGO to complete much faster and likely doesn't sacrifice training quality substantially. Let's adopt its strategy.
1 parent 4b5c9ff commit 8816616

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

cpython-windows/build.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,57 @@
9999
}
100100

101101

102+
# Tests to run during PGO profiling.
103+
#
104+
# This set was copied from test.libregrtest.pgo in the CPython source
105+
# distribution.
106+
PGO_TESTS = {
107+
"test_array",
108+
"test_base64",
109+
"test_binascii",
110+
"test_binop",
111+
"test_bisect",
112+
"test_bytes",
113+
"test_bz2",
114+
"test_cmath",
115+
"test_codecs",
116+
"test_collections",
117+
"test_complex",
118+
"test_dataclasses",
119+
"test_datetime",
120+
"test_decimal",
121+
"test_difflib",
122+
"test_embed",
123+
"test_float",
124+
"test_fstring",
125+
"test_functools",
126+
"test_generators",
127+
"test_hashlib",
128+
"test_heapq",
129+
"test_int",
130+
"test_itertools",
131+
"test_json",
132+
"test_long",
133+
"test_lzma",
134+
"test_math",
135+
"test_memoryview",
136+
"test_operator",
137+
"test_ordered_dict",
138+
"test_pickle",
139+
"test_pprint",
140+
"test_re",
141+
"test_set",
142+
"test_sqlite",
143+
"test_statistics",
144+
"test_struct",
145+
"test_tabnanny",
146+
"test_time",
147+
"test_unicode",
148+
"test_xml_etree",
149+
"test_xml_etree_c",
150+
}
151+
152+
102153
def log(msg):
103154
if isinstance(msg, bytes):
104155
msg_str = msg.decode("utf-8", "replace")
@@ -1889,6 +1940,10 @@ def build_cpython(
18891940
tests = [l.strip() for l in tests.decode("utf-8").splitlines() if l.strip()]
18901941

18911942
for test in sorted(tests):
1943+
# Only look at specific tests, to keep runtime down.
1944+
if test not in PGO_TESTS:
1945+
continue
1946+
18921947
# test_regrtest hangs for some reason. It is the test for the
18931948
# test harness itself and isn't exercising useful code. Skip it.
18941949
if test == "test_regrtest":

0 commit comments

Comments
 (0)