← Back to team overview

kicad-developers team mailing list archive

Re: Performance issues in pcbnew

 

Le 25/07/2017 à 05:09, hauptmech a écrit :
> 
> This would be a demo for testing only. I'll have to obfuscate and sabatoge parts.  Still useful?
> 
> 
> On 25/07/17 02:07, Wayne Stambaugh wrote:
>> I would accept a patch for a more complex demo for performance testing
>> purposes.
>>
>> On 7/24/2017 4:05 AM, Kristoffer Ödmark wrote:
>>> I for one would really appreciate having a larger testproject in the demos.
>>>
>>> - Kristoffer
>>>
>>> On 07/24/2017 01:36 AM, hauptmech wrote:
>>>> I'm getting a distracting amount of lag when panning and zooming with
>>>> GAL. Perf reports TOOL_MANAGER::dispatchInternal and, when eeschema is
>>>> open, SCH_SHEET_LIST::BuildSheetList, as the main time sinks.
>>>>
>>>> Anyone have any hints for me improve this?
>>>>
>>>> In general I'm getting the impression that the design I'm working on
>>>> is a bit more complex than the developers normally test on. I'll see
>>>> if my client will allow a sanitized version of this board to go into
>>>> /demos.
>>>>
>>>> -hauptmech
>>>>

Could you test this patch, and see if it changes something in performance issues in pcbnew?
Thanks.

-- 
Jean-Pierre CHARRAS
 common/basicframe.cpp       |  2 +-
 eeschema/sch_sheet_path.cpp | 12 ------------
 eeschema/sch_sheet_path.h   |  9 +--------
 eeschema/schframe.cpp       | 12 ++++++++----
 4 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/common/basicframe.cpp b/common/basicframe.cpp
index 6608750..c24c6eb 100644
--- a/common/basicframe.cpp
+++ b/common/basicframe.cpp
@@ -168,7 +168,7 @@ bool EDA_BASE_FRAME::ProcessEvent( wxEvent& aEvent )
     if( !wxFrame::ProcessEvent( aEvent ) )
         return false;
 
-    if( IsShown() && m_hasAutoSave &&
+    if( IsShown() && m_hasAutoSave && IsActive() &&
         (m_autoSaveState != isAutoSaveRequired()) && (m_autoSaveInterval > 0) )
     {
         if( !m_autoSaveState )
diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp
index 108b244..bc2a0f0 100644
--- a/eeschema/sch_sheet_path.cpp
+++ b/eeschema/sch_sheet_path.cpp
@@ -502,18 +502,6 @@ bool SCH_SHEET_LIST::IsModified()
 }
 
 
-bool SCH_SHEET_LIST::IsAutoSaveRequired()
-{
-    for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
-    {
-        if( (*it).LastScreen() && (*it).LastScreen()->IsSave() )
-            return true;
-    }
-
-    return false;
-}
-
-
 void SCH_SHEET_LIST::ClearModifyStatus()
 {
     for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
diff --git a/eeschema/sch_sheet_path.h b/eeschema/sch_sheet_path.h
index eff5aae..ec891b9 100644
--- a/eeschema/sch_sheet_path.h
+++ b/eeschema/sch_sheet_path.h
@@ -1,7 +1,7 @@
 /*
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
- * Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
+ * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
  * Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@xxxxxxxxxxx>
  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
  *
@@ -355,13 +355,6 @@ public:
      */
     bool IsModified();
 
-    /**
-     * Function IsAutoSaveRequired
-     * checks the entire hierarchy for any modifications that require auto save.
-     * @return True if the hierarchy is modified otherwise false.
-     */
-    bool IsAutoSaveRequired();
-
     void ClearModifyStatus();
 
     /**
diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp
index aa08851..ec547ea 100644
--- a/eeschema/schframe.cpp
+++ b/eeschema/schframe.cpp
@@ -1,8 +1,8 @@
 /*
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
- * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
- * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
+ * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -1267,9 +1267,13 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
 
     if( g_RootSheet != NULL )
     {
-        SCH_SHEET_LIST sheetList( g_RootSheet );
+        SCH_SCREENS screenList;
 
-        return sheetList.IsAutoSaveRequired();
+        for( SCH_SCREEN* screen = screenList.GetFirst(); screen; screen = screenList.GetNext() )
+        {
+            if( screen->IsSave() )
+                return true;
+        }
     }
 
     return false;

Follow ups

References