From 74998790e82a490c0fc69549a5e35e7356904e3c Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 3 Jun 2024 11:33:29 -0700 Subject: [PATCH] Turn off incremental connectivity for small schematics The benefit of incremental connectivity is only for larger schematics. For smaller schematics, the downside of larger bug surface outweighs the current benefits --- eeschema/connection_graph.h | 12 ++++++++++++ eeschema/sch_edit_frame.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/eeschema/connection_graph.h b/eeschema/connection_graph.h index bc25b95e44..eac2cc74b0 100644 --- a/eeschema/connection_graph.h +++ b/eeschema/connection_graph.h @@ -472,6 +472,18 @@ public: */ void ExchangeItem( SCH_ITEM* aOldItem, SCH_ITEM* aNewItem ); + /** + * We modify how we handle the connectivity graph for small graphs vs large + * graphs. Partially this is to avoid unneeded complexity for small graphs, + * where the performance of the graph is not a concern. This is considered + * a temporary solution until the connectivity graph is refactored with an + * eye toward partial updates + */ + bool IsMinor() const + { + return m_items.size() < 10000; + } + private: /** * Update the graphical connectivity between items (i.e. where they touch) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 7da4a8b455..cada5b0288 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1779,7 +1779,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL }; if( !ADVANCED_CFG::GetCfg().m_IncrementalConnectivity || aCleanupFlags == GLOBAL_CLEANUP - || m_undoList.m_CommandsList.empty() ) + || m_undoList.m_CommandsList.empty()|| Schematic().ConnectionGraph()->IsMinor() ) { // Update all rule areas so we can cascade implied connectivity changes std::unordered_set all_screens;