[Webkit-unassigned] [Bug 109597] Cache timer heap pointer to timers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 12 18:34:17 PST 2013


--- Comment #4 from Alexey Proskuryakov <ap at webkit.org>  2013-02-12 18:36:31 PST ---
(From update of attachment 187896)
View in context: https://bugs.webkit.org/attachment.cgi?id=187896&action=review

It is worrisome that these functions are so incredibly hot that TLS access - a very fast operation - shows up on the profile.

> Source/WebCore/platform/Timer.h:85
> +    const Vector<TimerBase*>& timerHeap() const { ASSERT(m_cachedThreadGlobalTimerHeap); return *m_cachedThreadGlobalTimerHeap; }
> +    Vector<TimerBase*>& timerHeap() { ASSERT(m_cachedThreadGlobalTimerHeap); return *m_cachedThreadGlobalTimerHeap; }

I don't think that differentiating between the two is meaningful. The first function casts away constness from "this" anyway, so const safety is violated despite having a separate const version of this function.

I suggest always returning a non-const reference, the timer heap is never immutable.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list