[webkit-changes] [WebKit/WebKit] 9ed2e7: Reduce ThreadSafeRefCounted.h compile time

Gerald Squelart noreply at github.com
Wed Aug 28 15:26:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ed2e706b2c70f1118d528abc89ac0b55d1d0fe9
      https://github.com/WebKit/WebKit/commit/9ed2e706b2c70f1118d528abc89ac0b55d1d0fe9
  Author: Gerald Squelart <g_squelart at apple.com>
  Date:   2024-08-28 (Wed, 28 Aug 2024)

  Changed paths:
    M Source/WTF/wtf/ThreadSafeRefCounted.h

  Log Message:
  -----------
  Reduce ThreadSafeRefCounted.h compile time
https://bugs.webkit.org/show_bug.cgi?id=278700
rdar://problem/134756505

Reviewed by Chris Dumez.

Found with clang -ftime-trace and ClangBuildAnalyzer.
The switch on the templated enum meant that each branch was present
in all specializations, so the WTF::Function (of the `deleteThis`
lambda) and its WTF::makeUnique was in all 38+k instantiations.

Changing the switch into a sequence of `if constexpr` blocks
massively reduces that compile time, in particular the default
`DestructionThread::Any` doesn't use `WTF::Function` at all.

* Source/WTF/wtf/ThreadSafeRefCounted.h:
(WTF::ThreadSafeRefCounted::deref const):
(WTF::ThreadSafeRefCounted::derefAllowingPartiallyDestroyed const):

Canonical link: https://commits.webkit.org/282871@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list