Opening a board takes significant time in Pcbnew compared to v5

Description

I switched from Debug builds of v5.99 to a proper Ubuntu release of v6 and I found that opening boards is really slow in v6. I originally thought this was coming from using Debug builds, but after migrating to the stable v6 build from packages it is still much slower compared to v5.

The most notable differences are on panels produced by KiKit. I have the following examples, all produced by the same KiKit command (with various KiCAD versions):

  • panel-v5.kicad_pcb: Generated with KiCAD 5.12. In v5 opens in less than 1 second, in v6 it takes 15 seconds to load.
  • When I save the previous panel in v6, I get panel-convertedtov6.kicad_pcb, that takes also about 15 seconds to load.
  • However, when I generate the exactly same panel in v6 (basically the same sequence of API calls as in v5), I get this file: panel-v6.kicad_pcb. This file takes 98 seconds to open on my machine although, the panel is fairly simple (less than 200 tracks, 36 footprints).

Is such a slow down expected (e.g., because of the new DRC engine)? What is the difference between panel-convertedtov6.kicad_pcb and panel-v6.kicad_pcb that causes such a tremendous difference in loading time? It is possible that this is KiKit fault, however, I wasn't able to trace any significant difference between invocation of the API between v5 and v6.

Steps to reproduce

  1. Open the files mentioned above in v5 and v6

  2. Observe the difference

  3. Open panel-v6.kicad_pcb in Pcbnew v6

  4. Observe the long loading time compared to panel-convertedtov6.kicad_pcb

KiCad Version

Application: KiCad PCB Editor

Version: 6.0.0-d3dd2cf0fa~116~ubuntu20.04.1, release build

Libraries:
	wxWidgets 3.0.4

Platform: Linux 5.11.0-41-generic x86_64, 64 bit, Little endian, wxGTK, regolith, x11

	wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.5.2
	Curl: 7.68.0
	ngspice: 31
	Compiler: GCC 9.3.0 with C++ ABI 1013

Build settings:
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON
Edited by Jan Mrázek