Bug 1302573: [MSE] P5. Always evict data as soon as we can. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sun, 25 Sep 2016 21:55:26 +1000
changeset 315237 1dd2d2b5c5c86ff3a034cdfbd4fbc64d6050b946
parent 315236 426dfc90db8ad193910e7759f9e98d3b4db4af11
child 315238 19e90148741868f6ee0b864696f16147fa121240
push id30745
push usercbook@mozilla.com
push dateTue, 27 Sep 2016 09:18:23 +0000
treeherdermozilla-central@7b050ca8ec64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1302573
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1302573: [MSE] P5. Always evict data as soon as we can. r=gerald While never evicting less than 512kB saves CPU cycles, it reduces the chances to evict data when we actually need to and requires currentTime to advance much further. MozReview-Commit-ID: LcQFFtarbbi
dom/media/mediasource/TrackBuffersManager.cpp
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -281,21 +281,16 @@ TrackBuffersManager::EvictData(const Tim
     "buffered=%lldkB, eviction threshold=%ukB, evict=%lldkB canevict=%ukB",
     GetSize() / 1024, EvictionThreshold() / 1024, toEvict / 1024,
     canEvict / 1024);
 
   if (toEvict <= 0) {
     mEvictionState = EvictionState::NO_EVICTION_NEEDED;
     return EvictDataResult::NO_DATA_EVICTED;
   }
-  if (toEvict <= 512*1024) {
-    // Don't bother evicting less than 512KB.
-    mEvictionState = EvictionState::NO_EVICTION_NEEDED;
-    return EvictDataResult::CANT_EVICT;
-  }
 
   EvictDataResult result;
 
   if (mBufferFull && mEvictionState == EvictionState::EVICTION_COMPLETED &&
       canEvict < uint32_t(toEvict)) {
     // Our buffer is currently full. We will make another eviction attempt.
     // However, the current appendBuffer will fail as we can't know ahead of
     // time if the eviction will later succeed.