Bug 672207. imglib: Time how long we spend in the decode loop. r=joe

For now this is a global counter, the eventual plan is to make this per image
format. This will be our proxy for how long we block the event loop.

--HG--
extra : rebase_source : b283fff38585825f5f46884e12508b6323e178b3
This commit is contained in:
Jeff Muizelaar 2011-07-20 17:51:54 -04:00
Родитель bd157c9e71
Коммит 55ec7d9986
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -56,6 +56,7 @@
#include "prenv.h"
#include "ImageLogging.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "nsPNGDecoder.h"
#include "nsGIFDecoder2.h"
@ -2669,7 +2670,8 @@ imgDecodeWorker::Run()
// Loop control
PRBool haveMoreData = PR_TRUE;
TimeStamp deadline = TimeStamp::Now() + TimeDuration::FromMilliseconds(gMaxMSBeforeYield);
TimeStamp start = TimeStamp::Now();
TimeStamp deadline = start + TimeDuration::FromMilliseconds(gMaxMSBeforeYield);
// We keep decoding chunks until one of three possible events occur:
// 1) We don't have any data left to decode
@ -2690,6 +2692,9 @@ imgDecodeWorker::Run()
image->mSourceData.Length() > image->mBytesDecoded;
}
TimeDuration decodeLatency = TimeStamp::Now() - start;
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_LATENCY, PRInt32(decodeLatency.ToMicroseconds()));
// Flush invalidations _after_ we've written everything we're going to.
// Furthermore, if this is a redecode, we don't want to do progressive
// display at all. In that case, let Decoder::PostFrameStop() do the

Просмотреть файл

@ -68,6 +68,8 @@ HISTOGRAM(PAGE_FAULTS_HARD, 8, 64 * 1024, 13, EXPONENTIAL, "Hard page faults (si
#endif
HISTOGRAM(SHUTDOWN_OK, 0, 1, 2, BOOLEAN, "Did the browser start after a successful shutdown")
HISTOGRAM(IMAGE_DECODE_LATENCY, 50, 5000000, 100, EXPONENTIAL, "Time spent decoding an image chunk (us)")
/**
* Networking telemetry
*/