eeschema: Slow on net highlighting

Bug #1806197 reported by NhatKhai
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
jean-pierre charras

Bug Description

I experiencing that the net highlight take >10seconds very click in the hierarchy sheet.
Here is the video: https://youtu.be/dfVeN8d0pnc
And the zip file of the project is attached.

This issue had talk about on: https://forum.kicad.info/t/are-there-any-kicad-6-speed-performance-concerning/13861/14

My OS is Windows 7 Enterprise SP1 x64
Rating: 6.6 Windows Experience Index
CPU: i5-4300M CPU @ 2.6GHz 2.6GHz
RAM: 8GB

Application: kicad
Version: (6.0.0-rc1-dev-1288-g59b0f553e), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
NhatKhai (nhatkhai) wrote :
Revision history for this message
Seth Hillbrand (sethh) wrote :

I was unable to recreate this using Mac or Linux. Perhaps this is a MSW-specific thing?

Revision history for this message
jean-pierre charras (jp-charras) wrote :

I am also unable to recreate it on W7 32 bits.

Revision history for this message
Aleksandr Sh (dsa-t) wrote :

For me, highlighting nets on this project takes about 2-3 seconds. On my more complicated projects, it takes about 5 seconds, and during that time KiCad uses much cpu.

This is only slow if Accelerated mode is selected.
Highlight nets is very fast in Fallback mode.

Application: kicad
Version: (6.0.0-rc1-dev-1291-g61b749f0b), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

There is definitely a slow down compared to the 5.0 branch on windows. I'm seeing around 2 seconds using the included test project on pretty fast hardware. It does seem odd that a simple project like this would have that long of a net highlight delay due to the opengl refresh.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Just to let you know, Jon Evans has refactored the connectivity algorithm in eeschema and one of the gains is significantly shorter time needed to highlight a net.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Good news.
This is especially important for large schematics.

But if the slow down happens only in opengl mode, the issue is not the connectivity calculation.

On my W7 32 bits install, I do not see this issue.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@JP, did you test with the project archive attached to this bug report with both 5.0.1 and the dev branch? The performance of the 5.1 branch is very fast where as the dev branch has the second or two delay.

Revision history for this message
NhatKhai (nhatkhai) wrote :

Give only 422 nets with giving this type of processor speed. I would strongly thing event with a worst O(n^2) algorithms still should not be that slow for 10 seconds on my computer. I which I can do a profiling it, but Visual Studio profiling crash my whole laptop event time I activated it! I try to remove all the VS, and reinstall it, but not that easy with MS stuff, they are like a messy web of dependencies!

Revision history for this message
jean-pierre charras (jp-charras) wrote :

@Wayne,

Yes, I tested this project on both versions:
V5.01 and master on Cairo give similar performances (very fast).

Master on Opengl is a bit slower ( time roughly 0.5 s ).
Of course Opengl refresh could be better optimized, but I do not see a few seconds calculation time.

For me the issue (in this project) is not the connectivity calculation.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@JP, I went back and tested with the fallback canvas and sure enough the performance was on par with 5.0.1. That being said, is there anything we can do to improve the opengl canvas net highlighting performance? Switching to the fallback canvas just to use the net highlight feature isn't really a workable solution.

Revision history for this message
NhatKhai (nhatkhai) wrote :

I try on the jenkins-103 build. It is faster, around ~1second - Which is kind of ok if this is not relate to number of wire/net draws on the schematic. If it does, we still have salable issue I think.

Application: kicad
Version: (5.0.2-1-g5d8c3e503), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
NhatKhai (nhatkhai) wrote :

I also wounder, giving current architecture of software, how hard it is to create a automatic test for this :-).

Revision history for this message
NhatKhai (nhatkhai) wrote :

This is not relative topic, but may relative to the same part of code, so I put the link to reference in here for now:
Size of problem: https://forum.kicad.info/t/getting-re-started-with-kicad/13961/5
1 Measure of performance: https://forum.kicad.info/t/getting-re-started-with-kicad/13961/7
I cannot share this project file, or I have to spend time on my own to distorted it before share.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Could someone test this patch.

I am thinking the display refresh is very fast with this patch, but on may install I do not really have refresh issues without this patch.

Thanks

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@JP, nice work! Your patch resolved the issue on my system.

Revision history for this message
Seth Hillbrand (sethh) wrote :

@JP- Tested on Linux. No adverse issues.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 58036382c1c7461270649f1fe46048a0f5dc684f
https://git.launchpad.net/kicad/patch/?id=58036382c1c7461270649f1fe46048a0f5dc684f

Changed in kicad:
status: New → Fix Committed
assignee: nobody → jean-pierre charras (jp-charras)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.