From 4742e255fc0220835da464902bded092425aa6e1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 7 Aug 2023 18:23:05 +0200 Subject: [PATCH] Fixes issue #1453: fixed performance issue which was caused by a deep search for texts in transient selection --- src/laybasic/laybasic/layFinder.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/laybasic/laybasic/layFinder.cc b/src/laybasic/laybasic/layFinder.cc index 0b756967f..be581c5d8 100644 --- a/src/laybasic/laybasic/layFinder.cc +++ b/src/laybasic/laybasic/layFinder.cc @@ -475,6 +475,8 @@ ShapeFinder::checkpoint () void ShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, const db::Box &scan_box, const db::DCplxTrans &vp, const db::ICplxTrans &t, int /*level*/) { + checkpoint (); + if (! m_context_layers.empty ()) { std::map::const_iterator ctx = m_cells_with_context.find (cell.cell_index ()); @@ -499,12 +501,12 @@ ShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, const db: if (! point_mode ()) { - checkpoint (); - for (std::vector::const_iterator l = layers ().begin (); l != layers ().end (); ++l) { if (layers ().size () == 1 || (layers ().size () > 1 && cell.bbox ((unsigned int) *l).touches (scan_box))) { + checkpoint (); + const db::Shapes &shapes = cell.shapes ((unsigned int) *l); db::ShapeIterator shape = shapes.begin_touching (scan_box, m_flags, mp_prop_sel, m_inv_prop_sel); @@ -560,6 +562,8 @@ ShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, const db: db::ShapeIterator shape = shapes.begin_touching (scan_box, m_flags, mp_prop_sel, m_inv_prop_sel); while (! shape.at_end ()) { + checkpoint (); + bool match = false; double d = std::numeric_limits::max ();