From a884943ece4003cc67df68ed108316351ca0b9aa Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Sat, 16 Jun 2012 09:22:33 +0000 Subject: [PATCH] Geography : all geography views : performance issue with a lot of places svn: r19848 --- src/plugins/view/geoclose.py | 1 + src/plugins/view/geoevents.py | 4 ++++ src/plugins/view/geofamclose.py | 1 + src/plugins/view/geofamily.py | 1 + src/plugins/view/geomoves.py | 1 + src/plugins/view/geoperson.py | 1 + src/plugins/view/geoplaces.py | 15 ++++++++++++++- 7 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/plugins/view/geoclose.py b/src/plugins/view/geoclose.py index cc356a096..8f02b0ff1 100644 --- a/src/plugins/view/geoclose.py +++ b/src/plugins/view/geoclose.py @@ -150,6 +150,7 @@ class GeoClose(GeoGraphyView): self.place_list_active = [] self.place_list_ref = [] self.cal = config.get('preferences.calendar-format-report') + self.no_show_places_in_status_bar = False def get_title(self): """ diff --git a/src/plugins/view/geoevents.py b/src/plugins/view/geoevents.py index 2f08c0210..44277ff50 100644 --- a/src/plugins/view/geoevents.py +++ b/src/plugins/view/geoevents.py @@ -129,6 +129,7 @@ class GeoEvents(GeoGraphyView): self.sort = [] self.generic_filter = None self.additional_uis.append(self.additional_ui()) + self.no_show_places_in_status_bar = False def get_title(self): """ @@ -278,6 +279,7 @@ class GeoEvents(GeoGraphyView): longitude = "" self.without = 0 self.cal = config.get('preferences.calendar-format-report') + self.no_show_places_in_status_bar = False if self.generic_filter: events_list = self.generic_filter.apply(dbstate.db) @@ -296,6 +298,8 @@ class GeoEvents(GeoGraphyView): self.sort = sorted(self.place_list, key=operator.itemgetter(3, 4, 6) ) + if self.nbmarkers > 500 : # performance issue. Is it the good value ? + self.no_show_places_in_status_bar = True self._create_markers() def bubble_message(self, event, lat, lon, marks): diff --git a/src/plugins/view/geofamclose.py b/src/plugins/view/geofamclose.py index 0e6b1ba9f..3d7ab012d 100644 --- a/src/plugins/view/geofamclose.py +++ b/src/plugins/view/geofamclose.py @@ -150,6 +150,7 @@ class GeoFamClose(GeoGraphyView): self.place_list_active = [] self.place_list_ref = [] self.cal = config.get('preferences.calendar-format-report') + self.no_show_places_in_status_bar = False def get_title(self): """ diff --git a/src/plugins/view/geofamily.py b/src/plugins/view/geofamily.py index f31271d04..c0f8cfff5 100644 --- a/src/plugins/view/geofamily.py +++ b/src/plugins/view/geofamily.py @@ -128,6 +128,7 @@ class GeoFamily(GeoGraphyView): self.nbmarkers = 0 self.sort = [] self.additional_uis.append(self.additional_ui()) + self.no_show_places_in_status_bar = False def get_title(self): """ diff --git a/src/plugins/view/geomoves.py b/src/plugins/view/geomoves.py index 5f7204664..c21d4ed38 100644 --- a/src/plugins/view/geomoves.py +++ b/src/plugins/view/geomoves.py @@ -152,6 +152,7 @@ class GeoMoves(GeoGraphyView): self.cal = config.get('preferences.calendar-format-report') self.markers_by_level = dict() self.count = dict() + self.no_show_places_in_status_bar = False def get_title(self): """ diff --git a/src/plugins/view/geoperson.py b/src/plugins/view/geoperson.py index b23505e36..c9f070a3a 100644 --- a/src/plugins/view/geoperson.py +++ b/src/plugins/view/geoperson.py @@ -156,6 +156,7 @@ class GeoPerson(GeoGraphyView): self.nbmarkers = 0 self.sort = [] self.additional_uis.append(self.additional_ui()) + self.no_show_places_in_status_bar = False def get_title(self): """ diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py index 99764f6da..0a13b269b 100644 --- a/src/plugins/view/geoplaces.py +++ b/src/plugins/view/geoplaces.py @@ -129,6 +129,7 @@ class GeoPlaces(GeoGraphyView): self.sort = [] self.generic_filter = None self.additional_uis.append(self.additional_ui()) + self.no_show_places_in_status_bar = False def get_title(self): """ @@ -238,10 +239,18 @@ class GeoPlaces(GeoGraphyView): self.without = 0 latitude = "" longitude = "" + self.no_show_places_in_status_bar = False # base "villes de france" : 38101 places : # createmap : 8'50"; create_markers : 1'23" # base "villes de france" : 38101 places : # createmap : 8'50"; create_markers : 0'07" with pixbuf optimization + # base "villes de france" : 38101 places : + # gramps 3.4 python 2.7 ( draw_markers are estimated when we move the map) + # 38101 places : createmap : 04'32"; create_markers : 0'04"; draw markers : N/A :: 0'03" + # 65598 places : createmap : 10'03"; create_markers : 0'07"; draw markers : N/A :: 0'05" + # gramps 3.5 python 2.7 new marker layer + # 38101 places : createmap : 03'09"; create_markers : 0'01"; draw markers : 0'04" + # 65598 places : createmap : 08'48"; create_markers : 0'01"; draw markers : 0'07" _LOG.debug("%s" % time.strftime("start createmap : " "%a %d %b %Y %H:%M:%S", time.gmtime())) if self.generic_filter: @@ -261,13 +270,17 @@ class GeoPlaces(GeoGraphyView): else: place = dbstate.db.get_place_from_handle(place_x) self._create_one_place(place) - _LOG.debug("%s" % time.strftime(" stop createmap and\nbegin sort : " + _LOG.debug(" stop createmap.") + _LOG.debug("%s" % time.strftime("begin sort : " "%a %d %b %Y %H:%M:%S", time.gmtime())) self.sort = sorted(self.place_list, key=operator.itemgetter(0) ) _LOG.debug("%s" % time.strftime(" end sort : " "%a %d %b %Y %H:%M:%S", time.gmtime())) + if self.nbmarkers > 500 : # performance issue. Is it the good value ? + self.no_show_places_in_status_bar = True + self._create_markers() def bubble_message(self, event, lat, lon, marks):