diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp
index 8ea781972067dd513b9988d831b41cae30802176..88df607599ae942100b10a171ac54e08b9ef6b31 100644
--- a/indra/llappearance/llpolymesh.cpp
+++ b/indra/llappearance/llpolymesh.cpp
@@ -302,7 +302,9 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
         BOOL status = FALSE;
         if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 )       /*Flawfinder: ignore*/
         {
+#ifdef SHOW_DEBUG
                 LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
+#endif
 
                 //----------------------------------------------------------------
                 // File Header (seek past it)
@@ -559,10 +561,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
                         numTris++;
                 }
 
+#ifdef SHOW_DEBUG
                 LL_DEBUGS() << "verts: " << numVertices 
                          << ", faces: "   << numFaces
                          << ", tris: "    << numTris
                          << LL_ENDL;
+#endif
 
                 //----------------------------------------------------------------
                 // NumSkinJoints
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index fa2e86396d02e2ce5ddabc56cd36a3409c7069cc..2b091c0dc3789f1055350a2b04487d8963d9b237 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -1429,7 +1429,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 {
 	if (!force_render && !hasMorph())
 	{
+#ifdef SHOW_DEBUG
 		LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL;
+#endif
 		return;
 	}
 	LL_RECORD_BLOCK_TIME(FTM_RENDER_MORPH_MASKS);
@@ -1470,7 +1472,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
 		success &= param->render( x, y, width, height );
 		if (!success && !force_render)
 		{
+#ifdef SHOW_DEBUG
 			LL_DEBUGS() << "Failed to render param " << param->getID() << " ; skipping morph mask." << LL_ENDL;
+#endif
 			return;
 		}
 	}
@@ -1556,8 +1560,10 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
                 // We can get bad morph masks during login, on minimize, and occasional gl errors.
                 // We should only be doing this when we believe something has changed with respect to the user's appearance.
 		{
-                       LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL;
-                        // clear out a slot if we have filled our cache
+#ifdef SHOW_DEBUG
+			LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL;
+#endif
+			// clear out a slot if we have filled our cache
 			S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1;
 			while ((S32)mAlphaCache.size() >= max_cache_entries)
 			{
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
index de3bf87cbb199bbc468930c6ec180021d58cafc6..4d6aba68ddf76be9b50b26a10043d3d42d52f620 100644
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -324,8 +324,10 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
 			mStaticImageRaw = NULL;
 			mStaticImageRaw = new LLImageRaw;
 			mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
-			mNeedsCreateTexture = TRUE;			
+			mNeedsCreateTexture = TRUE;
+#ifdef SHOW_DEBUG
 			LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
+#endif
 		}
 
 		if (mCachedProcessedTexture)
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index db3b537d318a8e3ed55c94f1d314bfb1dd2a374c..25e17a887160da42844af20d34cafbb5aa530aa2 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -173,7 +173,9 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
 		{
 			if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true))
 			{
+#ifdef SHOW_DEBUG
 				LL_DEBUGS("Avatar") << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL;
+#endif
 				continue;
 			}
 		}
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 09ed104e59555afc3cf7f6ae38fa11f7f5b1e1ee..af94cce3c4d4f1009f6903ddd99d72f83331e2f9 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -247,7 +247,9 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
 		// request asset
 		mAssetStatus = ASSET_FETCHED;
 
+#ifdef SHOW_DEBUG
         LL_DEBUGS("Animation") << "Requesting data fetch for: " << mID << LL_ENDL;
+#endif
 		character_id = new LLUUID(mCharacter->getID());
 		gAssetStorage->getAssetData(mID,
 						LLAssetType::AT_ANIMATION,
@@ -346,7 +348,9 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
 		return STATUS_FAILURE;
 	}
 
+#ifdef SHOW_DEBUG
 	LL_DEBUGS() << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << LL_ENDL;
+#endif
 
 	LLDataPackerBinaryBuffer dp(anim_data, anim_file_size);
 
@@ -2104,7 +2108,9 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
 				return;
 			}
 
+#ifdef SHOW_DEBUG
 			LL_DEBUGS("Animation") << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;
+#endif
 			
 			LLDataPackerBinaryBuffer dp(buffer.get(), size);
 			if (motionp->deserialize(dp, asset_uuid))
diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp
index bafb63f31b4c6bc39597820178c1698257e442e8..9afd53d10771cd6935d7e563c5c1b9d62bf907e9 100644
--- a/indra/llcharacter/llvisualparam.cpp
+++ b/indra/llcharacter/llvisualparam.cpp
@@ -352,9 +352,11 @@ void LLVisualParam::setParamLocation(EParamLocation loc)
 	{
 		// no action
 	}
+#ifdef SHOW_DEBUG
 	else
 	{
 		LL_DEBUGS() << "param location is already " << mParamLocation << ", not slamming to " << loc << LL_ENDL;
 	}
+#endif
 }
 
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp
index bd40236ee04caa6252d5577e61a4748754e9e1cb..193ea372d6555e7395fafa83c6a7c36e82bdba47 100644
--- a/indra/llcommon/llfasttimer.cpp
+++ b/indra/llcommon/llfasttimer.cpp
@@ -237,8 +237,10 @@ void BlockTimer::incrementalUpdateTimerTree()
 {
 				// since ancestors have already been visited, re-parenting won't affect tree traversal
 			//step up tree, bringing our descendants with us
+#ifdef SHOW_DEBUG
 			LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
 				" to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
+#endif
 			timerp->setParent(timerp->getParent()->getParent());
 				accumulator.mParent = timerp->getParent();
 				accumulator.mMoveUpTree = false;
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 8ade219ce486179fbbda4d7c2fde708485dad8b9..9a956fb69990c1c804af4c3c0d94b81375a0ebeb 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -858,9 +858,11 @@ LLMemoryInfo& LLMemoryInfo::refresh()
 {
 	mStatsMap = loadStatsMap();
 
+#if SHOW_DEBUG
 	LL_DEBUGS("LLMemoryInfo") << "Populated mStatsMap:\n";
 	LLSDSerialize::toPrettyXML(mStatsMap, LL_CONT);
 	LL_ENDL;
+#endif
 
 	return *this;
 }
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 1ba36f0ad9804e089bed00d61d2db2ba804f42ce..3c92bcdeaee501ff92774c33a0b78a2c3507abad 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -133,8 +133,10 @@ LLAvatarNameCache::~LLAvatarNameCache()
 
 void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLUUID> agentIds)
 {
+#if SHOW_DEBUG
     LL_DEBUGS("AvNameCache") << "Entering coroutine " << LLCoros::getName()
         << " with url '" << url << "', requesting " << agentIds.size() << " Agent Ids" << LL_ENDL;
+#endif
 
     // Check pointer that can be cleaned up by cleanupClass()
     if (!sHttpRequest || !sHttpOptions || !sHttpHeaders)
@@ -152,7 +154,9 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vector<LLU
         LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("NameCache", sHttpPolicy);
         LLSD results = httpAdapter.getAndSuspend(sHttpRequest, url);
 
+#if SHOW_DEBUG
         LL_DEBUGS() << results << LL_ENDL;
+#endif
 
         if (!results.isMap())
         {
@@ -282,7 +286,9 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
         LLAvatarNameCache::mPendingQueue.erase(agent_id);
 
         LLAvatarName& av_name = existing->second;
+#if SHOW_DEBUG
         LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " << agent_id << LL_ENDL;
+#endif
 		av_name.dump();
 
 		 // Reset expiry time so we don't constantly rerequest.
@@ -384,12 +390,15 @@ void LLAvatarNameCache::requestNamesViaCapability()
 
     if (!url.empty())
     {
+#ifdef SHOW_DEBUG
         LL_DEBUGS("AvNameCache") << "requested " << ids << " ids" << LL_ENDL;
-
-        std::string coroname = 
+        std::string coroname =
+#endif
             LLCoros::instance().launch("LLAvatarNameCache::requestAvatarNameCache_",
             boost::bind(&LLAvatarNameCache::requestAvatarNameCache_, url, agent_ids));
+#ifdef SHOW_DEBUG
         LL_DEBUGS("AvNameCache") << coroname << " with  url '" << url << "', agent_ids.size()=" << agent_ids.size() << LL_ENDL;
+#endif
 
 	}
 }
@@ -416,10 +425,12 @@ void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id,
 										const std::string& full_name,
 										bool is_group)
 {
+#ifdef SHOW_DEBUG
 	LL_DEBUGS("AvNameCache") << "LLAvatarNameCache agent " << agent_id << " "
 							 << "full name '" << full_name << "'"
 	                         << ( is_group ? " [group]" : "" )
 	                         << LL_ENDL;
+#endif
 	
 	// Construct an av_name record from this name.
 	LLAvatarName av_name;
@@ -444,7 +455,9 @@ void LLAvatarNameCache::requestNamesViaLegacy()
 		// invoked below.  This should never happen in practice.
 		mPendingQueue[agent_id] = now;
 
+#ifdef SHOW_DEBUG
 		LL_DEBUGS("AvNameCache") << "agent " << agent_id << LL_ENDL;
+#endif
 
 		gCacheName->get(agent_id, false,  // legacy compatibility
 			boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3));
@@ -589,10 +602,12 @@ void LLAvatarNameCache::eraseUnrefreshed()
             const LLAvatarName& av_name = it->second;
             if (av_name.mExpires < max_unrefreshed)
             {
+#ifdef SHOW_DEBUG
                 LL_DEBUGS("AvNameCacheExpired") << "LLAvatarNameCache " << it->first 
                                          << " user '" << av_name.getAccountName() << "' "
                                          << "expired " << now - av_name.mExpires << " secs ago"
                                          << LL_ENDL;
+#endif
                 mCache.erase(it++);
                 expired++;
             }
@@ -818,10 +833,12 @@ bool LLAvatarNameCache::expirationFromCacheControl(LLCore::HttpHeaders *headers,
             fromCacheControl = true;
         }
     }
+#ifdef SHOW_DEBUG
     LL_DEBUGS("AvNameCache")
         << ( fromCacheControl ? "expires based on cache control " : "default expiration " )
         << "in " << *expires - now << " seconds"
         << LL_ENDL;
+#endif
 
     return fromCacheControl;
 }
@@ -863,10 +880,12 @@ bool LLAvatarNameCache::expirationFromCacheControl(const LLSD& headers, F64 *exp
 			fromCacheControl = true;
 		}
 	}
+#ifdef SHOW_DEBUG
 	LL_DEBUGS("AvNameCache") << "LLAvatarNameCache "
 		<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
 		<< "in " << *expires - now << " seconds"
 		<< LL_ENDL;
+#endif
 	
 	return fromCacheControl;
 }
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 8f6e955936105db3c2b5b74aa1ba867bddf6a53b..9bda805d63faf3eafd41252587a9fadb55cdc34d 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -280,8 +280,10 @@ void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdap
         const LLSD& row = *it;
         LLUUID public_key = row[EXPERIENCE_ID].asUUID();
 
+#if SHOW_DEBUG
         LL_DEBUGS("ExperienceCache") << "Received result for " << public_key
             << " display '" << row[LLExperienceCache::NAME].asString() << "'" << LL_ENDL;
+#endif
 
         processExperience(public_key, row);
     }
@@ -460,7 +462,9 @@ bool LLExperienceCache::fetch(const LLUUID& key, bool refresh/* = true*/)
 {
 	if(!key.isNull() && !isRequestPending(key) && (refresh || mCache.find(key)==mCache.end()))
 	{
+#if SHOW_DEBUG
 		LL_DEBUGS("ExperienceCache") << " queue request for " << EXPERIENCE_ID << " " << key << LL_ENDL;
+#endif
 
         mRequestQueue.insert(key);
 		return true;
diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp
index ae3e00e9f37998d61dcecc12efe9d5036987cc1f..371c503e5f302812c0e811bb687c2e2bfe9a07d3 100644
--- a/indra/llmessage/llsdmessagebuilder.cpp
+++ b/indra/llmessage/llsdmessagebuilder.cpp
@@ -385,7 +385,9 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data)
 void LLSDMessageBuilder::copyFromLLSD(const LLSD& msg)
 {
 	mCurrentMessage = msg;
+#if SHOW_DEBUG
 	LL_DEBUGS() << LLSDNotationStreamer(mCurrentMessage) << LL_ENDL;
+#endif
 }
 
 const LLSD& LLSDMessageBuilder::getMessage() const
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 965991c30321fe3982b92aad513d0471512d992d..f8a0987160a078d4c41f588edc6ebc1090bce626 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -1403,7 +1403,9 @@ S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name
 	tec.face_count = llmin((U32)getNumTEs(),(U32)LLTEContents::MAX_TES);
 
 	U8 *cur_ptr = tec.packed_buffer;
+#if SHOW_DEBUG
     LL_DEBUGS("TEXTUREENTRY") << "Texture Entry with buffere sized: " << tec.size << LL_ENDL;
+#endif
     U8 *buffer_end = tec.packed_buffer + tec.size;
 
     if (!(  unpack_TEField<LLUUID>(tec.image_data, tec.face_count, cur_ptr, buffer_end, MVT_LLUUID) &&
@@ -1537,7 +1539,9 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
 	U32 i;
 
     U8 *cur_ptr = packed_buffer;
+#if SHOW_DEBUG
     LL_DEBUGS("TEXTUREENTRY") << "Texture Entry with buffer sized: " << size << LL_ENDL;
+#endif
     U8 *buffer_end = packed_buffer + size;
 
     if (!(  unpack_TEField<LLUUID>(image_data, face_count, cur_ptr, buffer_end, MVT_LLUUID) &&
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 0c041f6071e20fcc5cc2e3b21b583e8352a430aa..e6f853375279aaab59634327a0b0690b90dfffeb 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -278,6 +278,7 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind)
 		}
 		else
 		{
+#if SHOW_DEBUG
 			if (texture)
 			{
 				LL_DEBUGS() << "NULL LLTexUnit::bind GL image" << LL_ENDL;
@@ -286,6 +287,7 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind)
 			{
 				LL_DEBUGS() << "NULL LLTexUnit::bind texture" << LL_ENDL;
 			}
+#endif
 			return false;
 		}
 	}
@@ -304,7 +306,9 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind)
 
 	if(!texture)
 	{
+#if SHOW_DEBUG
 		LL_DEBUGS() << "NULL LLTexUnit::bind texture" << LL_ENDL;
+#endif
 		return false;
 	}
 
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index d56e96825b7c830d3363a55aacd3d2799c265d13..050c21781a5828343ab52a0afb6778b02f3c5c2e 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -439,10 +439,12 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
 			setFocus(TRUE);
 		}
 
+#if SHOW_DEBUG
 		if (!mFunctionName.empty())
 		{
 			LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL;
 		}
+#endif
 
 		/*
 		 * ATTENTION! This call fires another mouse down callback.
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index d5fb2287c6b13afdeea9a95540f91e920e051fae..852c5ced14cc6b64a79aafb16a94c485a39a95d8 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1586,7 +1586,9 @@ BOOL LLFloater::handleScrollWheel(S32 x, S32 y, S32 clicks)
 // virtual
 BOOL LLFloater::handleMouseUp(S32 x, S32 y, MASK mask)
 {
+#if SHOW_DEBUG
 	LL_DEBUGS() << "LLFloater::handleMouseUp calling LLPanel (really LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL;
+#endif
 	BOOL handled = LLPanel::handleMouseUp(x,y,mask); // Not implemented in LLPanel so this actually calls LLView
 
 #if AL_VIEWER_EVENT_RECORDER
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index f66a87cd9433d473b402fde2d5e133be96a9e0a8..b5276cbf491e1ee4b66b9dd7a48ed5219f7e3d66 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -241,9 +241,10 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
 			*it = it->beginMap()->second;
 		}
 	}
-
+#if SHOW_DEBUG
 	LL_DEBUGS("Notifications") << name << LL_ENDL;
 	LL_DEBUGS("Notifications") << ll_pretty_print_sd(mFormData) << LL_ENDL;
+#endif
 }
 
 LLNotificationForm::LLNotificationForm(const LLSD& sd)
@@ -434,9 +435,11 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
 	{
 		mUniqueContext.push_back(context.value);
 	}
-	
+
+#if SHOW_DEBUG
 	LL_DEBUGS("Notifications") << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL;
-	
+#endif
+
 	for (const LLNotificationTemplate::Tag& tag : p.tags)
 	{
 		LL_DEBUGS("Notifications") << "    tag \"" << std::string(tag.value) << "\"" << LL_ENDL;
@@ -1487,7 +1490,9 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
 			if (found != replacements.end())
 			{
 				replacement = found->second;
+#if SHOW_DEBUG
 				LL_DEBUGS("Notifications") << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL;
+#endif
 				it->second->setValue(replacement);
 			}
 			else
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index ca1aaaf54d63d8a0b934a105889ef163b000710c..1605221cca79d03424b40009cd54c3e930b704d1 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -824,7 +824,9 @@ BOOL LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params&
 		return didPost;
 	}
 
+#if SHOW_DEBUG
 	LL_DEBUGS() << "Building panel " << filename << LL_ENDL;
+#endif
 
 	LLUICtrlFactory::instanceFast().pushFileName(filename);
 	{