Bug 1321878 P1 Don't exclude child process and IPC transit time from Performance API network timings. r=mayhemer a=jcristau
authorBen Kelly <ben@wanderview.com>
Fri, 06 Jan 2017 06:31:01 -0800
changeset 353387 b67e9aafeaa5e04ec730c0b5551aba36bd76f939
parent 353386 a63790bb648932cbeeef01e0c076afaa136758ef
child 353388 0c3414e6f0b2535f7b7668e835fbfe2401c43bb0
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer, jcristau
bugs1321878
milestone52.0a2
Bug 1321878 P1 Don't exclude child process and IPC transit time from Performance API network timings. r=mayhemer a=jcristau
netwerk/protocol/http/HttpChannelChild.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -894,17 +894,24 @@ HttpChannelChild::OnStopRequest(const ns
 
   mTransactionTimings.domainLookupStart = timing.domainLookupStart;
   mTransactionTimings.domainLookupEnd = timing.domainLookupEnd;
   mTransactionTimings.connectStart = timing.connectStart;
   mTransactionTimings.connectEnd = timing.connectEnd;
   mTransactionTimings.requestStart = timing.requestStart;
   mTransactionTimings.responseStart = timing.responseStart;
   mTransactionTimings.responseEnd = timing.responseEnd;
-  mAsyncOpenTime = timing.fetchStart;
+
+  // Do not overwrite or adjust the original mAsyncOpenTime.  We must use the
+  // original child process time in order to account for child side work and IPC
+  // transit overhead.  This depends on TimeStamp being equivalent across
+  // processes.  We work hard to ensure this on modern hardware, but there could
+  // be some variance on older devices.
+  MOZ_DIAGNOSTIC_ASSERT(mAsyncOpenTime <= timing.fetchStart);
+
   mRedirectStartTimeStamp = timing.redirectStart;
   mRedirectEndTimeStamp = timing.redirectEnd;
   mTransferSize = timing.transferSize;
   mEncodedBodySize = timing.encodedBodySize;
   mProtocolVersion = timing.protocolVersion;
 
   mCacheReadStart = timing.cacheReadStart;
   mCacheReadEnd = timing.cacheReadEnd;