GeoNode/geonode — pull request #1375 by mwengren (2014-02-19 14:49:03+00:00)
Title: Improve speed of gsconfig resource retrieval 

Not sure if there are still users out there with some slow response times in using updatelayers, but I made a few changes awhile ago in this branch to see if performance could be improved by passing workspace and store params to gsconfig when retrieving layer references in layers/models.py. These values should always be found in GeoNode's internal database, so it shouldn't ever raise errors.

If you have GeoNode running against a GeoServer with many workspaces, and then especially many layers within many workspaces, you'll see some pretty slow update times pretty quickly. The GeoServer I've been testing with has only ~450 layers, but with these changes when updatelayers is run (with --workspace and --store specified), I've seen 3x to 4x faster update times per layer most cases, and sometimes much greater than that.

The issue is that without workspace and store being passed to Catalog.get_resource in gsconfig, it will always iterate through the entire list of workspaces and stores to find the layer in question.