⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249232 in webkit


Ignore:
Timestamp:
Aug 28, 2019, 7:24:03 PM (7 years ago)
Author:
Simon Fraser
Message:

PaintFrequencyTracker triggers too many calls to MonotonicTime::now() on layer painting
https://bugs.webkit.org/show_bug.cgi?id=201261

Reviewed by Zalan Bujtas.

MonotonicTime::now() shows up as expensive when painting layer-heavy content, because PaintFrequencyTracker
makes two calls per layer paint.

Halve the number of calls by storing m_lastPaintTime at the start of the paint; doing so doesn't substantially
change the behavior of the tracker.

  • rendering/PaintFrequencyTracker.h:

(WebCore::PaintFrequencyTracker::begin):
(WebCore::PaintFrequencyTracker::end):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249223 r249232  
     12019-08-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        PaintFrequencyTracker triggers too many calls to MonotonicTime::now() on layer painting
     4        https://bugs.webkit.org/show_bug.cgi?id=201261
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        MonotonicTime::now() shows up as expensive when painting layer-heavy content, because PaintFrequencyTracker
     9        makes two calls per layer paint.
     10
     11        Halve the number of calls by storing m_lastPaintTime at the start of the paint; doing so doesn't substantially
     12        change the behavior of the tracker.
     13
     14        * rendering/PaintFrequencyTracker.h:
     15        (WebCore::PaintFrequencyTracker::begin):
     16        (WebCore::PaintFrequencyTracker::end):
     17
    1182019-08-28  Ross Kirsling  <ross.kirsling@sony.com>
    219
  • trunk/Source/WebCore/rendering/PaintFrequencyTracker.h

    r230274 r249232  
    6262            m_paintFrequency = PaintFrequency::High;
    6363        }
     64
     65        m_lastPaintTime = now;
     66        ++m_totalPaints;
    6467    }
    6568
    6669    void end()
    6770    {
    68         m_lastPaintTime = MonotonicTime::now();
    6971        ASSERT(m_firstPaintTime);
    7072        ASSERT(m_firstPaintTime <= m_lastPaintTime);
    71         ++m_totalPaints;
    7273    }
    7374
Note: See TracChangeset for help on using the changeset viewer.