Hello fellow devs,
Over the years dealing with GUI of KiCad, I believe most users on Windows experienced significant delays when opening (and closing) dialogs. And that part is already affecting the experience a lot: opening the Board Setup dialog from Pcbnew takes more than 1 second on my Ryzen 9 workstation (!!), while on my M1 MacBook Air it's about half a second.
A quick survey in our Chinese community chat reveals that 40% users experience 2~5 seconds of delay (their processors ranging from 4th-gen Core i5 to Ryzen 7 8845H); more than 60% users would feel Windows version had a longer delay than other platforms.
I made a local build of master branch, and profiled the execution
while opening and closing Board Setup 5 times in a row.
VS Profiler reveals that 61.24% of CPU time is consumed in unknown
code that resides in kernel space (Win32K.sys, syscall processing
code, etc), and 13.85% CPU time is used on win32u. Only ~13% were
actually wxWidgets overhead. With 5730 samples taken at a rate of
1kSa/s, that meant each time I open Board Setup, 1.146s is wasted
inside kernel space.

(Third column is the CPU time consumed in a specific function of a
module, excluding calls to other functions)
With my knowledge on how Windows works, I would say wxMSW is
hugely inefficient due to the fact it utilizes Windows "native"
controls from comctl32 and other stuff. This might seem
counterintuitive, but Windows apps really suffered from these
"native" controls. Each of these controls are Win32 window objects
that resides in kernel space, and any manipulation on them require
at least a syscall. And due to the fact that kernel always take
extra care checking userspace data, plus address space switching
overhead, eventually made our dialog performance a lot worse than
other platforms.
I am aware that we probably should focus more on feature parity with mature tools rather than UI framework. However wxMSW has constantly been an issue (lack of dark mode support, IME hang bug, a mysterious "toolbar icons collapsing into a thin piece" bug in Chinese community that can't be stably reproduced but occurs on many people's machines), and I'm curious what we can do about the wxMSW situation (maybe use GTK on Windows?).
Rigo
--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion visit https://groups.google.com/a/kicad.org/d/msgid/devlist/3d909c69-792d-4436-b23f-45bc01c93466%40gmail.com.