eeschema has higher idle CPU usage than pcbnew
Description
After opening a schematic with several pages, eeschema's CPU use stays high.
Steps to reproduce
- Open schematic with several pages (the more the higher the CPU use)
- Observe CPU percentage in e.g.
top(1)
KiCad Version
Application: Eeschema
Version: (5.1.7-1-gca8f026bc), release build
Libraries:
wxWidgets 3.0.5
libcurl/7.72.0 OpenSSL/1.1.1h zlib/1.2.11 zstd/1.4.5 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0
Platform: Linux 5.8.8-arch1-1 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.72.0
OpenCASCADE Technology: 7.4.0
Curl: 7.71.1
Compiler: GCC 10.1.0 with C++ ABI 1014
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=OFF
KICAD_USE_OCC=ON
KICAD_SPICE=ON
Causes
Investigation with perf
and gdb
show that wxWidgets frequently sends wxUpdateUIEvent
to SCH_EDIT_FRAME::OnUpdateSave
. OnUpdateSave
builds a new SCH_SHEET_LIST
on every event, which is an expensive operation.
Edited by Simon Schubert