Poor performance when opening gerbers

Bug #1745203 reported by Hildo Guillardi Júnior
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Expired
Low

Bug Description

I am using nightly compilation c6d0075~61~ubuntu 16.04.

When I try to open a gbrjob on GerbView, the software freeze or at least spend a long (really long) time to load and render all layers (and when do the screen is not focused on the board, this is in some place away in the black dashboard).

At the process all the menu bars appear unconfigured and still after finish (check the screen).

The board have 7 GERBERs files: 2 copper, silks, masks and edge.

Tags: gerbview
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Jon Evans (craftyjon) wrote :

Are you able to share your gerber files (either here, or in private email to one of the developers?) After the freeze, does it eventually start working?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I don't if is related with the graphical card. I just tested now other PC (same OS and KiCad compilation). The gbrfile is loaded well, just the menu that I highlighted still strange.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I just tested now other PC (same OS and KiCad compilation). Same behavior, slow load and the menu problem.

Revision history for this message
Jon Evans (craftyjon) wrote :

Are you using legacy graphics or modern (accelerated or fallback)?
I will check on my machine later and see if it has the same issue.
Thanks

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

I confirm loading these files is *very* slow in OpenGL mode, and fast in other modes (Legacy or Cairo) (W7 32bits).

There is a similar issue: long time when switching ON or OFF the DCodes display.

Note: when loading the same files by selecting them by File/Load Gerber File, the loading time is normal.
But:
- switching ON or OFF the DCodes display is very slow
- Sort layers if X2 mode is very slow.

So, the issue is perhaps not at loading time, but after loading, when sorting layers (loading the .gbrjob does the sorting).
and long time when switching ON or OFF the DCodes display is strange.

I also confirm the display of auxiliary horizontal toolbar is incorrect after loading a file, in GAL mode.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

@jean, I agree selecting all the GERBERs files (not the gbrjob) works normal (sure, after I have to load the drills).
I am using modern accelerated mode.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

In modern fallback and legacy works normally. Now that I test, I saw that even after the files be loaded (in other graphical mode), just change the graphic mode to modern-accelerated causes the same issue.

Jon Evans (craftyjon)
Changed in kicad:
importance: Undecided → Medium
status: New → Confirmed
Jon Evans (craftyjon)
Changed in kicad:
assignee: nobody → Jon Evans (craftyjon)
Revision history for this message
Jon Evans (craftyjon) wrote :

FYI I think there are two things to tackle here:

1) The Gerber X2 attributes are not correctly causing the dropdowns to re-layout. This is a bug and should be fixed.

2) The particular design here is slow to load due to the size. It's actually slow no matter what mode you are in, but in OpenGL the drawing is all done up-front (and cached) so it appears as "slow file loading" but in the other modes (Legacy/Cairo) panning/zooming is quite slow because of how many objects have to be drawn. This is also what is causing the slow D-code display, since our OpenGL text drawing is not super performant and there are lots of D-codes to display.

I can look to see if there are obvious ways to speed up the performance here, but unless there are low-hanging fruit I don't know if it will make it in for V5.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

@crafyjon, I agree if the (1) and (2).
Sure, the size of the board (quantity of track and vias) create a long gerber file, is understandable that will be slower than "common" designs (also the 3D generation in pcbnew is quite slow because this).
So, fix (1) and the menu is priority of the issue (my point of view). And if some enhancement of Geberview could be done, will be nice to future user that try large designs (but this is a enhancement, not a bug fix, so can be treated more calmly).

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

@Jon,
Do your best. You are one of your GAL specialist, and we have very few GAL specialists.

The 2) is certainly an optimization problem because it takes the same time to switch On and switch OFF the D_Codes, and roughly the same time when loading files with D_Codes display option is ON).

After the V5 RC1, I am expecting we will have other releases.
So, take your time to work on this issue.

FYI, on my computer, the Legacy and the Cairo renders are fast (as fast as the Cairo render of gerbv).

I am seeing these gerber files as interesting test files.

Thanks.

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

Fixed in revision 14abe8723db6fddfa6c6207688fec2c36a7cc818
https://git.launchpad.net/kicad/patch/?id=14abe8723db6fddfa6c6207688fec2c36a7cc818

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Jon Evans (craftyjon) wrote :

#1 is fixed, #2 is still open, so setting back to Confirmed

Changed in kicad:
status: Fix Committed → Confirmed
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Thanks @Jon Evans, the #1 is really fixed.
But #2, now (20180202540+b420845~61ubuntu16.04.01), happens in all Modern Canvas (Accelerated and Fallback) for all GEBERs that I have, even GerbView now is not just freezing but closing.
In Legacy graphics mode all is fine.

Revision history for this message
Jon Evans (craftyjon) wrote :

Hi Hildo, if you are getting closing (crash?) please open a new bug with a stack trace if possible. I will consider this bug to track the issue that OpenGL canvas is slow to load when you give it lots of complicated files, but if you are actually getting a crash that is a different bug.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

@Evans, I opened a a different bug relating this (https://bugs.launchpad.net/kicad/+bug/1747409). How can I do the stack trace for help you?

tags: added: gerbview
Revision history for this message
Jon Evans (craftyjon) wrote :

@Hildo could you please try the next nightly (29-Feb) and let me know what you think? There is now a progress bar for long file loads, and many other small issues have been fixed.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Not a leap year. :-D
Report from 201803011436+ce1bd4c~62~ubuntu16.04.1:
1) Open the file attached in this issue is ok now, much better. Thanks;
2) I didn't see the process bar (maybe because the Job GERBER file was considered not to long?);
3) The problem still when I switch between the graphical modes in the preferences menu.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I tried in my older machine, same software (OS) configuration:
1) Yes!
2) I saw the process bar (maybe it could be in the bottom toolbar of GergerView, but works nice);
3) Still this issue of switching graphical modes.

Revision history for this message
Jon Evans (craftyjon) wrote :

What problem do you see when you switch graphical modes?

I agree the progress bar could be better as a status bar feature than a popup, but for now it is easier to re-use this progress bar popup that already exists in the code.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

@Jon, yes, the progress bar is Low priority.

When I switch the the graphical mode, GerberView hangs (in the 2 machines that I tested, one new and older older one, both Ubuntu).

Jon Evans (craftyjon)
Changed in kicad:
status: Confirmed → Triaged
importance: Medium → Low
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

The process bar feature is duplicated at https://bugs.launchpad.net/kicad/+bug/1780123

Revision history for this message
Jeff Young (jeyjey) wrote :

Do we still have a performance issue when switching canvases in GerbView, or can this be closed?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Yes, still some, using the GERBERs that I attached on

Application: kicad
Version: 6.0.0-rc1-unknown-86273e8~66~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.15.0-38-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

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=OFF
    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

Changing Accelerated -> Legacy, Pcbnew have a slow render, but it is ok (I think).
Returning Fallback -> Modern Accelerated GerberViewer freeze and became gray (standard for "not responding" software in Ubuntu)
Legacy -> Accelerated Fallback : works normally
Accelerated Fallback -> Modern Accelerated : same error above.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

*Read GeberViwer canvas on "Pcbnew" word

Jeff Young (jeyjey)
summary: - GerbView freeze when open gbrjob
+ Poor performance when open gbrjob
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote : Re: Poor performance when open gbrjob

Not just opening the grbjob, but opening all the gerbers directly.

Jeff Young (jeyjey)
summary: - Poor performance when open gbrjob
+ Poor performance when opening gerbers
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1844

Changed in kicad:
status: Triaged → Expired
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.