qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.38k stars 2.98k forks source link

Browser very slow when opening directory containing several GDB #53265

Closed jfbourdon closed 1 year ago

jfbourdon commented 1 year ago

What is the bug or the crash?

The browser takes a long time to show the content of a directory containing several ESRI File Geodatabase (up to about 100 seconds in my case for a folder with 132 GDB each containing about 20 layers and tables). During this time, QGIS is unresponsive and I can see via CPU and disk usage that it is doing "something". Once the directory opened, scrolling in the browser is slow and jaggy. Closing the directory restore the fluidity of the browser. Clicking on a GDB is also sluggish. Draging a layer is sluggish.

I looked at https://github.com/qgis/QGIS/issues/51595 and https://github.com/qgis/QGIS/issues/51848 but those issues don't correspond exactly to what I'm experiencing. The driver used (ESRI FileGDB or OpenFileGDB driver) doesn't seem to have too much of an impact in the loading time.

Based on all the QGIS versions I tested, I'm under the impression that the issue isn't with GDAL/OGR but rather with the new browser features introduced in 3.28 (see changelog).

Steps to reproduce the issue

  1. In the Browser Panel, navigate to a folder containing tens of big GDB (doing so this with only a few GDB doesn't show as much)
  2. Once opened, scroll in the browser to see that it isn't smooth
  3. Open a GDB and drag-drop a layer onto the canvas to see the slugginess of the operation

The test can be performed with all the GDB inside all the zipped files available at https://diffusion.mern.gouv.qc.ca/Diffusion/RGQ/Vectoriel/Carte_Topo/Local/GRHQ/FGDB/. The times with this dataset aren't as bad as with the GDB I'm currently using, but the difference between near instant and 12 seconds stay pretty clear along with the jaggy scrolling .

Versions

I tested this with several version of QGIS:

QGIS GDAL Directory display time in browser
3.22.8 3.5.0 Near instant
3.22.16 3.6.2 Near instant
3.24.2 3.4.2 Near instant
3.26.0 3.5.0 Near instant
3.28.3 3.6.2 98 seconds
3.30.1 3.6.3 23 seconds
3.30.2 3.7.0 23 seconds

Supported QGIS version

New profile

Additional context

No response

nyalldawson commented 1 year ago

Thanks for the detailed bug report!

jfbourdon commented 1 year ago

I downloaded the weekly snapshot (b9736bd33d) to test the fix and the improvement is very noticeable: smooth drag and drop, smooth scrolling and faster loading time for a folder full of GDB. However, for this last part, it's still several seconds slower than in <= 3.26. It essentialy only halved the times of 3.30 with 12 seconds for my original dataset and 6 seconds for the linked dataset.

Is there a way for me to try diagnose what is going on my machine? There must be some more requests made to each GDB compared to <= 3.26. Could it be a Windows specific issue?

jfbourdon commented 1 year ago

To be sure that it wasn't a weird issue with our corporate Windows environment at work, I tested the same QGIS versions and same datasets on my personal computer (also Windows 10) and I can confirm the same behaviour.

nyalldawson commented 1 year ago

@jfbourdon

Should be fixed by https://github.com/qgis/QGIS/pull/53398

jfbourdon commented 1 year ago

Thanks @nyalldawson ! It now works as expected: fast and smooth!