[Qgis-developer] SpatiaLite very slow with QGIS 1.7

Martin Dobias wonder.sk at gmail.com
Sun Mar 20 13:32:41 EDT 2011


On Sun, Mar 20, 2011 at 11:09 AM,  <a.furieri at lqt.it> wrote:
> I've prepared a very small test suite you can use to
> reproduce this issue in the easiest way:
> http://www.gaia-gis.it/merano_shp.zip
>
> ----------------------
> shortly said: the test suite contains a SpatiaLite
> DB storing some 110+ layers; anyway each single
> layer simply contains one or two features only,
> so it is an ultra-light weighted dataset.
> and I've included Shapefiles as well, exactly
> corresponding to DB layers.
>
> the same identical slowness affects both SpatiaLite
> and Shapefiles (and I strongly suspect, any other vector
> datasource): it looks like an exponentially increasing
> time is required to add (or remove) any further layer.
> so adding very few layers requires a quite unnoticeable
> time: but adding several tenths (or hundredths) layers
> at the same time requires an intolerable time.

Thanks for the testing suite. I have run it with a profiler and found
out that it is (surprisingly) caused by QgsSnappingDialog. It is
created on application startup, each time when a layer is added to map
layer registry it updates itself: creates tree widget items, combo
boxes etc. Disabling the update slot connection it takes ~3s to open
all the layers and quitting is instantaneous.

I wonder what would be the best fix for this. Probably a change from
tree widget to tree view+model: an added layer would only update the
model, not (re)create all the stuff. I will leave the fix for someone
else :-)

Martin


More information about the Qgis-developer mailing list