# HG changeset patch # User Christophe de Vienne # Date 1420254366 -3600 # Node ID 62e1f9749d3ae1402d6c7a7e656260729618966f # Parent e14ec2aac099763e674646eca821947848329272 [entities] Optimize CWUser.properties. This property gets called each time a user connects to a repository, which means a lot. This optimisation cuts its execution time by 5 according to my tests diff -r e14ec2aac099 -r 62e1f9749d3a entities/authobjs.py --- a/entities/authobjs.py Tue Mar 04 12:41:21 2014 +0100 +++ b/entities/authobjs.py Sat Jan 03 04:06:06 2015 +0100 @@ -74,7 +74,11 @@ try: return self._properties except AttributeError: - self._properties = dict((p.pkey, p.value) for p in self.reverse_for_user) + self._properties = dict( + self._cw.execute( + 'Any K, V WHERE P for_user U, U eid %(userid)s, ' + 'P pkey K, P value V', + {'userid': self.eid})) return self._properties def prefered_language(self, language=None):