← Back to team overview

kicad-developers team mailing list archive

Re: Performance issues in pcbnew

 

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.

> I do not think this is the explanation of Performance issues in pcbnew,
> however SCH_EDIT_FRAME::IsAutoSaveRequired() needs an optimization:
> no need to call BuildSheetList() to know if a screen is modified, especially if the SCH_EDIT_FRAME
> does not have the focus.

That's one potential short term fix.  I would still like to know why the
schematic editor frame is getting mouse events when the board editor
frame has the focus.

> 
>>
>>> 4) CTRL C stop perf
>>> 5) > perf report
>>>
>>> On a release build SCH_SHEET_LIST() or a sub function shows up at the top.
>>>
>>>
>>>
>>> On 25/07/17 10:25, Wayne Stambaugh wrote:
>>>> On 7/24/2017 6:12 PM, hauptmech wrote:
>>>>> Yeah, it's weird since all I'm doing when collecting perf data is
>>>>> zooming and panning the pcb, (with eeschema open).  A root page and 11
>>>>> sub pages at the next level. Roughly 800 components and 2000 wires.
>>>>>
>>>>> Probably something somewhere is instantiating a new SCH_SHEET_LIST
>>>>> (which then has to chew through each and every schematic item to find
>>>>> the sheets) on every event?
>>>> This is even more disturbing.  When did we start building the sheet list
>>>> in pcbnew and more importantly why?
>>>>
>>>>>
>>>>>
>>>>> On 25/07/17 01:59, Wayne Stambaugh wrote:
>>>>>> On 7/23/2017 7:36 PM, 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.
>>>>>> Given that all BuildSheetList does is create a list of unique sheets in
>>>>>> a schematic, I find it difficult to believe that you would have that
>>>>>> many sheets (hierarchical or otherwise) that would cause a performance
>>>>>> hit.  How many sheets does your design have and how deeply are they
>>>>>> nested?
>>>>>>
>>>>>>> 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
>>>>>>>
> 
> 
> 


Follow ups

References