From 10d9cbc601e5cadc45163452b1bc463d8ad2c1f7 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Wed, 29 Mar 2023 21:03:36 +0100 Subject: [PATCH] Reduce resolver rounds by an order of magnitude (#11908) Co-authored-by: Pradyun Gedam --- news/11908.feature.rst | 1 + src/pip/_internal/resolution/resolvelib/resolver.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 news/11908.feature.rst diff --git a/news/11908.feature.rst b/news/11908.feature.rst new file mode 100644 index 00000000000..2b9ec18d98f --- /dev/null +++ b/news/11908.feature.rst @@ -0,0 +1 @@ +Reduce the number of resolver rounds, since backjumping makes the resolver more efficient in finding solutions. This also makes pathological cases fail quicker. diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py index a605d6c254f..47bbfecce36 100644 --- a/src/pip/_internal/resolution/resolvelib/resolver.py +++ b/src/pip/_internal/resolution/resolvelib/resolver.py @@ -88,9 +88,9 @@ def resolve( ) try: - try_to_avoid_resolution_too_deep = 2000000 + limit_how_complex_resolution_can_be = 200000 result = self._result = resolver.resolve( - collected.requirements, max_rounds=try_to_avoid_resolution_too_deep + collected.requirements, max_rounds=limit_how_complex_resolution_can_be ) except ResolutionImpossible as e: