Reduce texture fetch and main thread contention from LLViewerStatsRecorder via simpleton.

meow-7.2.2
Rye Mutt 2024-08-13 18:45:50 -04:00
parent 2cff1e217b
commit 6dbf1cafb2
4 changed files with 6 additions and 16 deletions

View File

@ -1284,6 +1284,7 @@ bool LLAppViewer::init()
//LLSimpleton creations
LLEnvironment::createInstance();
LLWorld::createInstance();
LLViewerStatsRecorder::createInstance();
LLSelectMgr::createInstance();
LLViewerCamera::createInstance();
LL::GLTFSceneManager::createInstance();
@ -2166,6 +2167,7 @@ bool LLAppViewer::cleanup()
LL::GLTFSceneManager::deleteSingleton();
LLEnvironment::deleteSingleton();
LLSelectMgr::deleteSingleton();
LLViewerStatsRecorder::deleteSingleton();
LLViewerEventRecorder::deleteSingleton();
LLWorld::deleteSingleton();
LLVoiceClient::deleteSingleton();

View File

@ -1285,7 +1285,6 @@ bool idle_startup()
//
// Initialize classes w/graphics stuff.
//
LLViewerStatsRecorder::instance(); // Since textures work in threads
LLSurface::initClasses();
display_startup();

View File

@ -27,16 +27,13 @@
#include "llviewerprecompiledheaders.h"
#include "llviewerstatsrecorder.h"
#include "llcontrol.h"
#include "llfile.h"
#include "llviewercontrol.h"
#include "llviewerregion.h"
#include "llviewerobject.h"
#include "llworld.h"
extern LLControlGroup gSavedSettings;
LLViewerStatsRecorder* LLViewerStatsRecorder::sInstance = NULL;
LLViewerStatsRecorder::LLViewerStatsRecorder() :
mStatsFile(NULL),
mTimer(),
@ -48,11 +45,6 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() :
mMaxDuration(300.f),
mSkipSaveIfZeros(false)
{
if (NULL != sInstance)
{
LL_ERRS() << "Attempted to create multiple instances of LLViewerStatsRecorder!" << LL_ENDL;
}
sInstance = this;
clearStats();
}

View File

@ -38,13 +38,12 @@
class LLMutex;
class LLViewerObject;
class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder>
class LLViewerStatsRecorder : public LLSimpleton<LLViewerStatsRecorder>
{
LLSINGLETON(LLViewerStatsRecorder);
public:
LLViewerStatsRecorder();
LOG_CLASS(LLViewerStatsRecorder);
~LLViewerStatsRecorder();
public:
// Enable/disable stats recording. This is broken down into two
// flags so we can record stats without writing them to the log
// file. This is useful to analyzing updates for scene loading.
@ -140,8 +139,6 @@ private:
void closeStatsFile();
void makeStatsFileName();
static LLViewerStatsRecorder* sInstance;
LLFILE * mStatsFile; // File to write data into
std::string mStatsFileName;