kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30152
Re: Performance issues in pcbnew
Le 25/07/2017 à 18:59, Wayne Stambaugh a écrit :
> On 7/25/2017 11:53 AM, jp charras wrote:
>> Le 25/07/2017 à 15:58, Wayne Stambaugh a écrit :
>>> On 7/24/2017 7:50 PM, hauptmech wrote:
>>>>
>>>> I haven't learned enough about the KIWAY to trace the events from pcbnew
>>>> to eeschema yet.
>>>>
>>>> I'd be curious is this is reproducible in other systems. Easy to test on
>>>> linux using the perf tool https://perf.wiki.kernel.org/index.php/Main_Page
>>>>
>>>> 1) run kicad, open a pcb and schematic of any size.
>>>> 2) in a terminal run > perf record -g -p $(pidof kicad)
>>>> 3) pan and zoom the pcb continuously for a statistically significant
>>>> time (about 15-30 sec works for me).
>>>
>>> This makes even less sense. Why would the schematic sheet list need to
>>> be rebuilt while panning and zooming a board in pcbnew? I'm assuming
>>> that this doesn't happen in the legacy canvas.
>>
>> In fact, SCH_EDIT_FRAME::IsAutoSaveRequired() (which calls BuildSheetList() ) is called on each
>> mouse event, even if the SCH_EDIT_FRAME does not have the focus (which is a bit strange).
>>
>> So this is not panning and zooming a board which calls BuildSheetList(), but any mouse move event.
>>
>
> I wonder why the schematic editor frame is getting mouse events when the
> board editor frame has the focus? It almost sounds like either we are
> doing something wrong or the wxWidgets mouse handling is broken.
>
Looks like EDA_BASE_FRAME::ProcessEvent( wxEvent& aEvent ) collects events, and calls
isAutoSaveRequired() to all frames shown, regardless the focus.
I am thinking the issue is in Kicad code, and is not a wxWidgets bug.
I could have a look into this if you want (although I did not write this code).
However I still think SCH_EDIT_FRAME::IsAutoSaveRequired() needs an optimization, because it
explores all schematic items to find the list of SCH_SCREEN, that is easily accessible, without
exploring all schematic items.
(I already fixed that in my working tree)
--
Jean-Pierre CHARRAS
References