Pasting items in schematic editor causes 100% CPU usage
Description
When duplicating or pasting an item in the schematic editor, I observe 100% CPU usage until I place the item. Placing new items or moving items does not cause this problem.
When I interrupted eeschema while it was happening, it was in this loop:
while( synchronousControl == STS_RUNNING )
{
wxYield();
}
7cb754dd removed a delay in this loop, which fixes lag while pasting, but also causes excessive CPU usage.
Steps to reproduce
- Duplicate or paste something in the schematic editor
- Monitor CPU usage
KiCad Version
Application: KiCad Schematic Editor x86_64 on x86_64
Version: 8.99.0-1022-gb9b19cb5fb, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.13.2
HarfBuzz 8.4.0
FontConfig 2.15.0
libcurl/8.7.1 OpenSSL/3.3.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 libssh2/1.11.0 nghttp2/1.61.0 nghttp3/1.2.0
Platform: Manjaro Linux, 64 bit, Little endian, wxGTK, X11, xfce, x11
OpenGL: AMD, AMD Radeon Graphics (radeonsi, renoir, LLVM 17.0.6, DRM 3.54, 6.6.29-1-MANJARO), 4.6 (Compatibility Profile) Mesa 24.0.6-manjaro1.1
Build Info:
Date: May 7 2024 11:35:28
wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.83.0
OCC: 7.7.2
Curl: 8.7.1
ngspice: 42
Compiler: GCC 13.2.1 with C++ ABI 1018
Build settings:
KICAD_USE_EGL=ON
Locale:
Lang: en_US
Enc: UTF-8
Num: 1,234.5