summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llfasttimer.h124
-rw-r--r--indra/llcommon/llmetrics.cpp2
-rw-r--r--indra/llcommon/llrefcount.h7
-rw-r--r--indra/llcommon/llsd.cpp10
-rw-r--r--indra/llcommon/llstring.cpp3
-rw-r--r--indra/llcommon/llstring.h9
6 files changed, 33 insertions, 122 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 612068b202..0d89353dee 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -69,13 +69,13 @@ public:
std::vector<NamedTimer*>& getChildren();
void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
- bool getCollapsed() { return mCollapsed; }
+ bool getCollapsed() const { return mCollapsed; }
- U64 getCountAverage() { return mCountAverage; }
- U64 getCallAverage() { return mCallAverage; }
+ U64 getCountAverage() const { return mCountAverage; }
+ U64 getCallAverage() const { return mCallAverage; }
- U64 getHistoricalCount(S32 history_index = 0);
- U64 getHistoricalCalls(S32 history_index = 0);
+ U64 getHistoricalCount(S32 history_index = 0) const;
+ U64 getHistoricalCalls(S32 history_index = 0) const;
static NamedTimer& getRootNamedTimer();
@@ -162,117 +162,6 @@ public:
NamedTimer& mNamedTimer;
};
- static DeclareTimer FTM_ARRANGE;
- static DeclareTimer FTM_ATTACHMENT_UPDATE;
- static DeclareTimer FTM_AUDIO_UPDATE;
- static DeclareTimer FTM_AUTO_SELECT;
- static DeclareTimer FTM_AVATAR_UPDATE;
- static DeclareTimer FTM_CLEANUP;
- static DeclareTimer FTM_CLIENT_COPY;
- static DeclareTimer FTM_CREATE_OBJECT;
- static DeclareTimer FTM_CULL;
- static DeclareTimer FTM_CULL_REBOUND;
- static DeclareTimer FTM_FILTER;
- static DeclareTimer FTM_FLEXIBLE_UPDATE;
- static DeclareTimer FTM_FRAME;
- static DeclareTimer FTM_FRUSTUM_CULL;
- static DeclareTimer FTM_GEN_FLEX;
- static DeclareTimer FTM_GEN_TRIANGLES;
- static DeclareTimer FTM_GEN_VOLUME;
- static DeclareTimer FTM_GEO_SKY;
- static DeclareTimer FTM_GEO_UPDATE;
- static DeclareTimer FTM_HUD_EFFECTS;
- static DeclareTimer FTM_HUD_UPDATE;
- static DeclareTimer FTM_IDLE;
- static DeclareTimer FTM_IDLE_CB;
- static DeclareTimer FTM_IDLE_NETWORK;
- static DeclareTimer FTM_IMAGE_CREATE;
- static DeclareTimer FTM_IMAGE_MARK_DIRTY;
- static DeclareTimer FTM_IMAGE_UPDATE;
- static DeclareTimer FTM_INVENTORY;
- static DeclareTimer FTM_JOINT_UPDATE;
- static DeclareTimer FTM_KEYHANDLER;
- static DeclareTimer FTM_LOAD_AVATAR;
- static DeclareTimer FTM_LOD_UPDATE;
- static DeclareTimer FTM_MESSAGES;
- static DeclareTimer FTM_MOUSEHANDLER;
- static DeclareTimer FTM_NETWORK;
- static DeclareTimer FTM_OBJECTLIST_UPDATE;
- static DeclareTimer FTM_OCCLUSION_READBACK;
- static DeclareTimer FTM_OCTREE_BALANCE;
- static DeclareTimer FTM_PICK;
- static DeclareTimer FTM_PIPELINE;
- static DeclareTimer FTM_POOLRENDER;
- static DeclareTimer FTM_POOLS;
- static DeclareTimer FTM_PROCESS_IMAGES;
- static DeclareTimer FTM_PROCESS_MESSAGES;
- static DeclareTimer FTM_PROCESS_OBJECTS;
- static DeclareTimer FTM_PUMP;
- static DeclareTimer FTM_REBUILD_GRASS_VB;
- static DeclareTimer FTM_REBUILD_PARTICLE_VB;
- static DeclareTimer FTM_REBUILD_TERRAIN_VB;
- static DeclareTimer FTM_REBUILD_VBO;
- static DeclareTimer FTM_REBUILD_VOLUME_VB;
- static DeclareTimer FTM_REFRESH;
- static DeclareTimer FTM_REGION_UPDATE;
- static DeclareTimer FTM_RENDER;
- static DeclareTimer FTM_RENDER_ALPHA;
- static DeclareTimer FTM_RENDER_BLOOM;
- static DeclareTimer FTM_RENDER_BLOOM_FBO;
- static DeclareTimer FTM_RENDER_BUMP;
- static DeclareTimer FTM_RENDER_CHARACTERS;
- static DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE;
- static DeclareTimer FTM_RENDER_FONTS;
- static DeclareTimer FTM_RENDER_FULLBRIGHT;
- static DeclareTimer FTM_RENDER_GEOMETRY;
- static DeclareTimer FTM_RENDER_GLOW;
- static DeclareTimer FTM_RENDER_GRASS;
- static DeclareTimer FTM_RENDER_INVISIBLE;
- static DeclareTimer FTM_RENDER_OCCLUSION;
- static DeclareTimer FTM_RENDER_SHINY;
- static DeclareTimer FTM_RENDER_SIMPLE;
- static DeclareTimer FTM_RENDER_TERRAIN;
- static DeclareTimer FTM_RENDER_TREES;
- static DeclareTimer FTM_RENDER_UI;
- static DeclareTimer FTM_RENDER_WATER;
- static DeclareTimer FTM_RENDER_WL_SKY;
- static DeclareTimer FTM_RESET_DRAWORDER;
- static DeclareTimer FTM_SHADOW_ALPHA;
- static DeclareTimer FTM_SHADOW_AVATAR;
- static DeclareTimer FTM_SHADOW_RENDER;
- static DeclareTimer FTM_SHADOW_SIMPLE;
- static DeclareTimer FTM_SHADOW_TERRAIN;
- static DeclareTimer FTM_SHADOW_TREE;
- static DeclareTimer FTM_SIMULATE_PARTICLES;
- static DeclareTimer FTM_SLEEP;
- static DeclareTimer FTM_SORT;
- static DeclareTimer FTM_STATESORT;
- static DeclareTimer FTM_STATESORT_DRAWABLE;
- static DeclareTimer FTM_STATESORT_POSTSORT;
- static DeclareTimer FTM_SWAP;
- static DeclareTimer FTM_TEMP1;
- static DeclareTimer FTM_TEMP2;
- static DeclareTimer FTM_TEMP3;
- static DeclareTimer FTM_TEMP4;
- static DeclareTimer FTM_TEMP5;
- static DeclareTimer FTM_TEMP6;
- static DeclareTimer FTM_TEMP7;
- static DeclareTimer FTM_TEMP8;
- static DeclareTimer FTM_UPDATE_ANIMATION;
- static DeclareTimer FTM_UPDATE_AVATAR;
- static DeclareTimer FTM_UPDATE_CLOUDS;
- static DeclareTimer FTM_UPDATE_GRASS;
- static DeclareTimer FTM_UPDATE_MOVE;
- static DeclareTimer FTM_UPDATE_PARTICLES;
- static DeclareTimer FTM_UPDATE_PRIMITIVES;
- static DeclareTimer FTM_UPDATE_SKY;
- static DeclareTimer FTM_UPDATE_TERRAIN;
- static DeclareTimer FTM_UPDATE_TEXTURES;
- static DeclareTimer FTM_UPDATE_TREE;
- static DeclareTimer FTM_UPDATE_WATER;
- static DeclareTimer FTM_UPDATE_WLPARAM;
- static DeclareTimer FTM_VFILE_WAIT;
- static DeclareTimer FTM_WORLD_UPDATE;
public:
enum RootTimerMarker { ROOT };
@@ -287,6 +176,7 @@ public:
LLFastTimer(NamedTimer::FrameState& timer)
: mFrameState(&timer)
{
+#if FAST_TIMER_ON
NamedTimer::FrameState* frame_state = mFrameState;
frame_state->mLastStartTime = get_cpu_clock_count();
mStartSelfTime = frame_state->mLastStartTime;
@@ -298,6 +188,7 @@ public:
mLastTimer = sCurTimer;
sCurTimer = this;
+#endif
}
~LLFastTimer()
@@ -332,6 +223,7 @@ public:
static S32 getCurFrameIndex() { return sCurFrameIndex; }
static void writeLog(std::ostream& os);
+ static const NamedTimer* getTimerByName(const std::string& name);
public:
static bool sPauseHistory;
diff --git a/indra/llcommon/llmetrics.cpp b/indra/llcommon/llmetrics.cpp
index 8db3284c42..30e5d435ae 100644
--- a/indra/llcommon/llmetrics.cpp
+++ b/indra/llcommon/llmetrics.cpp
@@ -71,7 +71,7 @@ void LLMetricsImpl::recordEventDetails(const std::string& location,
metrics["location"] = location;
metrics["stats"] = stats;
- llinfos << "LLMETRICS: " << LLSDNotationStreamer(metrics) << llendl;
+ llinfos << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << llendl;
}
// Store this:
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index 540a18b8a0..d3597b454c 100644
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -32,6 +32,8 @@
#ifndef LLREFCOUNT_H
#define LLREFCOUNT_H
+#include <boost/noncopyable.hpp>
+
//----------------------------------------------------------------------------
// RefCount objects should generally only be accessed by way of LLPointer<>'s
// see llthread.h for LLThreadSafeRefCount
@@ -40,10 +42,9 @@
class LLRefCount
{
protected:
- LLRefCount(const LLRefCount&); // not implemented
+ LLRefCount(const LLRefCount& other); // no implementation
private:
- LLRefCount&operator=(const LLRefCount&); // not implemented
-
+ LLRefCount& operator=(const LLRefCount&); // no implementation
protected:
virtual ~LLRefCount(); // use unref()
diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index ba0f798dbb..9140ebb3f3 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -819,9 +819,15 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
{
std::ostringstream out;
if (useXMLFormat)
- out << LLSDXMLStreamer(llsd);
+ {
+ LLSDXMLStreamer xml_streamer(llsd);
+ out << xml_streamer;
+ }
else
- out << LLSDNotationStreamer(llsd);
+ {
+ LLSDNotationStreamer notation_streamer(llsd);
+ out << notation_streamer;
+ }
out_string = out.str();
}
int len = out_string.length();
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index ec1718a8cb..d7da40d645 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -42,6 +42,9 @@
#include <winnls.h> // for WideCharToMultiByte
#endif
+LLFastTimer::DeclareTimer STRING_LOCALIZATION("String Localization");
+
+
std::string ll_safe_string(const char* in)
{
if(in) return std::string(in);
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index f6bb0e0fe2..a15d6a9a14 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -38,6 +38,7 @@
#include <iomanip>
#include <boost/regex.hpp>
#include "llsd.h"
+#include "llfasttimer.h"
#if LL_LINUX || LL_SOLARIS
#include <wctype.h>
@@ -337,6 +338,9 @@ public:
// Copies src into dst at a given offset.
static void copyInto(std::basic_string<T>& dst, const std::basic_string<T>& src, size_type offset);
+ static bool isPartOfWord(T c) { return (c == (T)'_') || LLStringOps::isAlnum(c); }
+
+
#ifdef _DEBUG
static void testHarness();
#endif
@@ -617,10 +621,13 @@ void LLStringUtilBase<T>::getTokens (std::basic_string<T> input, std::vector<std
}
}
+extern LLFastTimer::DeclareTimer STRING_LOCALIZATION;
+
// static
template<class T>
S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const format_map_t& substitutions)
{
+ LLFastTimer ft(STRING_LOCALIZATION);
S32 res = 0;
std::basic_ostringstream<T> output;
@@ -695,6 +702,8 @@ S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const format_map_t& sub
template<class T>
S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const LLSD& substitutions)
{
+ LLFastTimer ft(STRING_LOCALIZATION);
+
S32 res = 0;
if (!substitutions.isMap())