I’ve created my part database on SQL and after linking it to KiCad i encounter a problem when trying to open the Choose Symbol menu.
I’ve measured the time and currently it takes around 80 seconds for it to open. After this everything is pretty smooth as usual. The database itself is pretty small (~450 entries), so not sure why it’s taking that long. Most of the components share the same symbol and footprint (e.g. SMA capacitors and resistors) and there are only a few unique (in terms of symbol and footprint) components as of yet.
Also I’ve noticed with the Task Manager that the CPU usage is not that high during this process, but the disk usage is around ~2-4MB/s for the whole time when loading the Choose Symbol. The task manager reports it to be write operations mainly. I’m using an SSD so it shouldn’t be a throughput issue. I’m also not using any antivirus apart from built in windows defender. The symbol and footprint libraries are on local disk and the database is on external server.
The Standard KiCad libraries are inactive and not visible and I am not using them. So far I’ve always thought that KiCad caches the database locally and refreshes it from time to time, but it seems not to be the case.
I’ll appreciate if anyone has an idea what could cause this or how to improve the loading time.
Edit: It seems that if I instead use the change symbol feature on existing schematic component the library loads much faster (6s-10s). Maybe because it’s not loading footprint previews?
Application: KiCad Schematic Editor x64 on x64
Version: 8.0.1, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.12.1
HarfBuzz 8.3.0
FontConfig 2.14.2
libcurl/8.5.0-DEV Schannel zlib/1.3
Platform: Windows 11 (build 22631), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Mar 15 2024 01:52:47
wxWidgets: 3.2.4 (wchar_t,wx containers)
Boost: 1.83.0
OCC: 7.7.1
Curl: 8.5.0-DEV
ngspice: 42
Compiler: Visual C++ 1936 without C++ ABI
Build settings:
i don’t think so, the symbol and footprint are local files on your machine isn’t it?
Which OS is hosting the DB?
My DB is much bigger (in the order of 15000 items, we tested both MySQL and MariaDB no perceived difference), we don’t see so large delays, just a 2…3 secs to startup, then faster (both win10 and Linux).
I have seen that when connected in remote with VPN the speed decreases, but nothing of the order of yours.
Do you have some tool to verify the performance of the DB? for example i use MySQL workbench, and use the performance dashboard for a general view.
Well there’s definitely some difference in the load time as add part button takes the 80s and change symbol one takes lets say 8s:
So the queries must differ between those two functionalities. But that’s just a side observation.
For the questions regarding the database, I’ll have to get this info from my colleague as he did the setup for the server. Unfortunately he’s on vacation till end of April, so I’ll have to wait for that. If I somehow get this info earlier then I’ll post it.
Anyway, thanks for sharing that on your setup it is working fine as it proves it is possible to set it up so it works correctly. This gives me a hint that I should look a bit deeper into database configuration. Maybe the current server setup is limiting access speed for the user.
yes, if i’ve got to place a bet, i’d say that the different behavior could arise from the component filters in the symbol chooser, just a conjecture without knowledge of the code internals.
Maybe craftyjon will chime-in in the discussion some time.
I did a check on a different machine with the same connection and there it it working fine. The main difference is that there is a win10 and kicad 8.0.0 there and maybe something different that I am not aware of. So in the server/DB side the configuration should be fine
I’ve added kicad.exe to windows security exception - no improvement in performance
I did find one option slowing down the connection which was enabled tracing in the ODBC driver. With tacing turned off there is an increase in the speed. But since I’ve found a place where I can track exact communication with the database I did some experimenting.
I’ve made a test on an empty project and tested the Choose Symbol operation. The observations are:
When there are no symbols from the database on the schematic there is one ENTER SQLPrepareW for each table present in the database. This changes however when components from the database are placed on the schematic.
0 components: 1 occurence
2 components: 5 occurences
5 components: 11 occurences
1078 components: 606 occurences (tool like 20minutes and produced a whopping 90MB log file from this single button press)
So it seems that for each component from the database present on the schematic additional 2 requests to refresh database are made. Why is that I have no idea.
For some reason, this scaling does not occur on my colleague’s PC.
I just tried connecting to my Kicad DB from a Windows 10 computer and I also find the reading of the database very slow. It takes a lot of time to show the symbols, select them and place them on the schematic.
Did you made progress solving this problem? Any other settings that helped?
I’m writing to clarify my previous post and provide an update.
Up until now, I’ve been using KiCad 7.0.11 on PopOS, but recently, some colleagues have joined me, and they work on Windows. I’ve also found myself needing to work on Windows occasionally. On my Ubuntu-based distribution, everything ran smoothly.
However, on Windows, I’ve encountered a similar issue to the original poster. While the library panel opens relatively quickly (8-15 seconds), it struggles significantly when selecting components from the tables. This is particularly noticeable in my library, where I have separate tables for resistors, capacitors, and so on. When I switch between tables, it either takes a long time to load or crashes.
I’ve also observed that tables from which I’ve previously selected a component open quickly without delays. However, when I switch to another table, it becomes slow again. It’s interesting to note that when I select a component in a new table, I can see the footprint preview loading, but it seems to struggle with loading the symbol. This is likely because it’s trying to retrieve data from the library.
As a test, I installed KiCad 8.0.3, and it performs much better. While there’s still some delay when opening the main component window, I can select and place components quickly once it’s open.
It appears that the slowness issues we’ve been experiencing were resolved sometime after version 7.0.11.
I wanted to share my findings and invite comments from fellow KiCad users.
I’ve gave up on digging any further as I decided to use the workaround with using the Change symbol option instead of Place new component. When I want to place a new component, then I just make a copy of anything already present and use the Change symbol to replace it to anything else.
Also, the only thing that sped up the access a little was disabling tracing/logging in the ODBC driver.
Kicad comes packaged with far more Symbols and Footprints than I need/use. I suspect this is true for many users so, I turned Off Active-State and Visibility.
Doing that brought down loading time from 40 seconds to 6 seconds (on my Mac). Did it for both symbols and footprints.