From b474b3c6806654e98ed33a0a01f9bd720631d775 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 30 Apr 2013 20:27:03 -0500 Subject: [PATCH] Avoid bogging down main thread with excessive LLInstanceTrackerBase::getInstances calls. --- indra/llcommon/llinstancetracker.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 403df0899..ecaf55586 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -54,7 +54,10 @@ protected: template static STATICDATA& getStatic() { - void *& instances = getInstances(typeid(TRACKED)); + //Singu note: Don't de-static the instances variable. getInstances is incredibly + //expensive. Calling getInstances once and caching the result is sufficient + //to avoid the instance-per-module issue noted above. + static void *& instances = getInstances(typeid(TRACKED)); if (! instances) { instances = new STATICDATA;