CRM-20226 [NFC] add comment to warn coders about performance impact
authoreileen <emcnaughton@wikimedia.org>
Thu, 21 Sep 2017 05:15:37 +0000 (17:15 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 21 Sep 2017 05:15:37 +0000 (17:15 +1200)
CRM/Contact/BAO/Group.php

index 6ebf3b8b96afd537101fd5d1fb970f3fda42a747..3273fbee88f4f494e370618a3bf561f9718aed2f 100644 (file)
@@ -1017,6 +1017,13 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
       }
 
       // get group contact count using Contact.GetCount API
+      // CRM-20226 This has been added here in order to address a specific bug. However, a prior
+      // decision was to refresh group counts less aggressively, offering instead a button to
+      // refresh them to give users a better experience by loading pages quicker.
+      // For some sites this can be crazy slow even though only 25 sites resolve. Even for sites
+      // with relatively few smart groups it is not a good user experience.
+      // Adding comments here as I'm not going to tackle a fix this time around but want
+      // to warn people off making it worse.
       $values[$object->id]['count'] = civicrm_api3('Contact', 'getcount', array('group' => $object->id));
     }