Skip to content

Commit 6dbf1ca

Browse files
committed
Reduce texture fetch and main thread contention from LLViewerStatsRecorder via simpleton.
1 parent 2cff1e2 commit 6dbf1ca

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

indra/newview/llappviewer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ bool LLAppViewer::init()
12841284
//LLSimpleton creations
12851285
LLEnvironment::createInstance();
12861286
LLWorld::createInstance();
1287+
LLViewerStatsRecorder::createInstance();
12871288
LLSelectMgr::createInstance();
12881289
LLViewerCamera::createInstance();
12891290
LL::GLTFSceneManager::createInstance();
@@ -2166,6 +2167,7 @@ bool LLAppViewer::cleanup()
21662167
LL::GLTFSceneManager::deleteSingleton();
21672168
LLEnvironment::deleteSingleton();
21682169
LLSelectMgr::deleteSingleton();
2170+
LLViewerStatsRecorder::deleteSingleton();
21692171
LLViewerEventRecorder::deleteSingleton();
21702172
LLWorld::deleteSingleton();
21712173
LLVoiceClient::deleteSingleton();

indra/newview/llstartup.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ bool idle_startup()
12851285
//
12861286
// Initialize classes w/graphics stuff.
12871287
//
1288-
LLViewerStatsRecorder::instance(); // Since textures work in threads
12891288
LLSurface::initClasses();
12901289
display_startup();
12911290

indra/newview/llviewerstatsrecorder.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,13 @@
2727
#include "llviewerprecompiledheaders.h"
2828
#include "llviewerstatsrecorder.h"
2929

30-
3130
#include "llcontrol.h"
3231
#include "llfile.h"
32+
#include "llviewercontrol.h"
3333
#include "llviewerregion.h"
3434
#include "llviewerobject.h"
3535
#include "llworld.h"
3636

37-
extern LLControlGroup gSavedSettings;
38-
39-
LLViewerStatsRecorder* LLViewerStatsRecorder::sInstance = NULL;
4037
LLViewerStatsRecorder::LLViewerStatsRecorder() :
4138
mStatsFile(NULL),
4239
mTimer(),
@@ -48,11 +45,6 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() :
4845
mMaxDuration(300.f),
4946
mSkipSaveIfZeros(false)
5047
{
51-
if (NULL != sInstance)
52-
{
53-
LL_ERRS() << "Attempted to create multiple instances of LLViewerStatsRecorder!" << LL_ENDL;
54-
}
55-
sInstance = this;
5648
clearStats();
5749
}
5850

indra/newview/llviewerstatsrecorder.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@
3838
class LLMutex;
3939
class LLViewerObject;
4040

41-
class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder>
41+
class LLViewerStatsRecorder : public LLSimpleton<LLViewerStatsRecorder>
4242
{
43-
LLSINGLETON(LLViewerStatsRecorder);
43+
public:
44+
LLViewerStatsRecorder();
4445
LOG_CLASS(LLViewerStatsRecorder);
4546
~LLViewerStatsRecorder();
46-
47-
public:
4847
// Enable/disable stats recording. This is broken down into two
4948
// flags so we can record stats without writing them to the log
5049
// file. This is useful to analyzing updates for scene loading.
@@ -140,8 +139,6 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder>
140139
void closeStatsFile();
141140
void makeStatsFileName();
142141

143-
static LLViewerStatsRecorder* sInstance;
144-
145142
LLFILE * mStatsFile; // File to write data into
146143
std::string mStatsFileName;
147144

0 commit comments

Comments
 (0)