From 81746e6a5ff2975d26f81060fd5ab58525d79cad Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 5 Apr 2022 18:22:47 -0700 Subject: [PATCH] reorder intersections to improve performance There are usually lots more vias than net polys/vertices, so it makes sense to check for overlap between nets before looking for vias. --- snarled/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snarled/main.py b/snarled/main.py index 22ae756..b58e14c 100644 --- a/snarled/main.py +++ b/snarled/main.py @@ -317,8 +317,8 @@ def find_merge_pairs( continue if via_polys is not None: - via_top = intersection_evenodd(top_polys, via_polys) - overlap = intersection_evenodd(via_top, bot_polys) + top_bot = intersection_evenodd(top_polys, bot_polys) + overlap = intersection_evenodd(top_bot, via_polys) else: overlap = intersection_evenodd(top_polys, bot_polys) # TODO verify there aren't any suspicious corner cases for this