diff options
-rw-r--r-- | indra/llimage/llimagej2c.cpp | 67 | ||||
-rw-r--r-- | indra/llimage/llimagej2c.h | 12 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 1 |
3 files changed, 62 insertions, 18 deletions
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 72aa253568..207728d4d9 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -294,6 +294,7 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time) // Returns TRUE to mean done, whether successful or not. BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count ) { + LLTimer elapsed; LLMemType mt1(mMemType); BOOL res = TRUE; @@ -311,12 +312,7 @@ BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir // Update the raw discard level updateRawDiscardLevel(); mDecoding = TRUE; - LLTimer elapsed; res = mImpl->decodeImpl(*this, *raw_imagep, decode_time, first_channel, max_channel_count); - if (LLImageJ2C::sTesterp) - { - LLImageJ2C::sTesterp->updateDecompressionStats(this->getDataSize(), raw_imagep->getDataSize(), elapsed.getElapsedTimeF32()) ; - } } if (res) @@ -337,6 +333,20 @@ BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 fir LLImage::setLastError(mLastError); } + if (LLImageJ2C::sTesterp) + { + // Decompression stat gathering + // Note that we *do not* take into account the decompression failures data so we night overestimate the time spent processing + + // Always add the decompression time to the stat + LLImageJ2C::sTesterp->updateDecompressionStats(elapsed.getElapsedTimeF32()) ; + if (res) + { + // The whole data stream is finally decompressed when res is returned as TRUE + LLImageJ2C::sTesterp->updateDecompressionStats(this->getDataSize(), raw_imagep->getDataSize()) ; + } + } + return res; } @@ -349,6 +359,7 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time) BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time) { + LLTimer elapsed; LLMemType mt1(mMemType); resetLastError(); BOOL res = mImpl->encodeImpl(*this, *raw_imagep, comment_text, encode_time, mReversible); @@ -356,6 +367,22 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, { LLImage::setLastError(mLastError); } + + if (LLImageJ2C::sTesterp) + { + // Compression stat gathering + // Note that we *do not* take into account the compression failures cases so we night overestimate the time spent processing + + // Always add the compression time to the stat + LLImageJ2C::sTesterp->updateCompressionStats(elapsed.getElapsedTimeF32()) ; + if (res) + { + // The whole data stream is finally compressed when res is returned as TRUE + LLImageJ2C::sTesterp->updateCompressionStats(this->getDataSize(), raw_imagep->getDataSize()) ; + } + } + + return res; } @@ -578,7 +605,6 @@ LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTester mTotalBytesInCompression = 0; mTotalBytesOutCompression = 0; - mTotalTimeDecompression = 0.0f; mTotalTimeCompression = 0.0f; } @@ -601,21 +627,40 @@ void LLImageCompressionTester::outputTestRecord(LLSD *sd) (*sd)[currentLabel]["TimeTimeCompression"] = (LLSD::Real)mTotalTimeCompression; } -void LLImageCompressionTester::updateCompressionStats(const S32 bytesIn, const S32 bytesOut, const F32 deltaTime) +void LLImageCompressionTester::updateCompressionStats(const F32 deltaTime) { - mTotalBytesInCompression += bytesIn; - mTotalBytesOutCompression += bytesOut; mTotalTimeCompression += deltaTime; } -void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const S32 bytesOut, const F32 deltaTime) +void LLImageCompressionTester::updateCompressionStats(const S32 bytesCompress, const S32 bytesRaw) +{ + mTotalBytesInCompression += bytesRaw; + mTotalBytesOutCompression += bytesCompress; + if (mTotalBytesInCompression > (1000000)) + { + // Output everything + outputTestResults(); + // Reset only the compression data + mTotalBytesInCompression = 0; + mTotalBytesOutCompression = 0; + mTotalTimeCompression = 0.0f; + } +} + +void LLImageCompressionTester::updateDecompressionStats(const F32 deltaTime) +{ + mTotalTimeDecompression += deltaTime; +} + +void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const S32 bytesOut) { mTotalBytesInDecompression += bytesIn; mTotalBytesOutDecompression += bytesOut; - mTotalTimeDecompression += deltaTime; if (mTotalBytesInDecompression > (5*1000000)) { + // Output everything outputTestResults(); + // Reset only the decompression data mTotalBytesInDecompression = 0; mTotalBytesOutDecompression = 0; mTotalTimeDecompression = 0.0f; diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index eeb00de6d2..adbfb9cdb3 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -127,18 +127,19 @@ protected: // // This class is used for performance data gathering only. // Tracks the image compression / decompression data, -// records and outputs them to metric log files. +// records and outputs them to metric.slp log files. // - class LLImageCompressionTester : public LLMetricPerformanceTesterBasic { public: LLImageCompressionTester(); ~LLImageCompressionTester(); - void updateDecompressionStats(const S32 bytesIn, const S32 bytesOut, const F32 deltaTime) ; - void updateCompressionStats(const S32 bytesIn, const S32 bytesOut, const F32 deltaTime) ; - + void updateDecompressionStats(const F32 deltaTime) ; + void updateDecompressionStats(const S32 bytesIn, const S32 bytesOut) ; + void updateCompressionStats(const F32 deltaTime) ; + void updateCompressionStats(const S32 bytesIn, const S32 bytesOut) ; + protected: /*virtual*/ void outputTestRecord(LLSD* sd); @@ -150,7 +151,6 @@ class LLImageCompressionTester : public LLMetricPerformanceTesterBasic U32 mTotalBytesOutDecompression; // Total bytes produced by decompressor U32 mTotalBytesInCompression; // Total bytes fed to compressor U32 mTotalBytesOutCompression; // Total bytes produced by compressor - // // Time // diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4e9ebce4d1..0440bef793 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1557,7 +1557,6 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con if (!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)) { // Only do partial requests for J2C at the moment - //llinfos << "Merov : LLTextureFetch::createRequest(), blocking fetch on " << url << llendl; desired_size = MAX_IMAGE_DATA_SIZE; desired_discard = 0; } |