Skip to content

Commit 1660a39

Browse files
authored
Try fixing test times after GC hack (#19766)
I am not sure what happens, but for some reason after GC `freeze()`/`unfreeze()` hack #19681 was merged, compiled tests are running twice slower (on GH runner, but I also see much smaller but visible slow-down locally). I have two theories: * The constant overhead we add outweighs the savings when running thousands of tiny builds. * The 8% of extra memory we use goes over the limit in the runner because we were already very close to it. In any case, I propose to try disabling this hack in most tests and see if it helps.
1 parent dcaca0e commit 1660a39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,7 +3364,8 @@ def process_graph(graph: Graph, manager: BuildManager) -> None:
33643364
# TODO: see if it's possible to determine if we need to process only a
33653365
# _subset_ of the past SCCs instead of having to process them all.
33663366
if (
3367-
platform.python_implementation() == "CPython"
3367+
not manager.options.test_env
3368+
and platform.python_implementation() == "CPython"
33683369
and manager.gc_freeze_cycles < MAX_GC_FREEZE_CYCLES
33693370
):
33703371
# When deserializing cache we create huge amount of new objects, so even
@@ -3379,7 +3380,8 @@ def process_graph(graph: Graph, manager: BuildManager) -> None:
33793380
for prev_scc in fresh_scc_queue:
33803381
process_fresh_modules(graph, prev_scc, manager)
33813382
if (
3382-
platform.python_implementation() == "CPython"
3383+
not manager.options.test_env
3384+
and platform.python_implementation() == "CPython"
33833385
and manager.gc_freeze_cycles < MAX_GC_FREEZE_CYCLES
33843386
):
33853387
manager.gc_freeze_cycles += 1

0 commit comments

Comments
 (0)