Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d6dbb473fd5a7ac01b3e1941ee3de02251d60e6a
      
https://github.com/WebKit/WebKit/commit/d6dbb473fd5a7ac01b3e1941ee3de02251d60e6a
  Author: Dan Glastonbury <[email protected]>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp

  Log Message:
  -----------
  Give each thread its own sampled gradient cache to avoid cross-thread 
thrashing
https://bugs.webkit.org/show_bug.cgi?id=314779
rdar://176555191

Reviewed by Simon Fraser.

GradientRendererCG::makeGradientBySampling() uses a static 8-entry TinyLRUCache
shared across all threads. When multiple threads sample gradients concurrently,
they evict each other's entries from the small cache, collapsing the hit rate
and forcing repeated CGGradientRef rebuilds.

Wrap the cache in WTF::ThreadSpecific so each thread gets its own 8-entry
LRU. The per-thread working set fits cleanly in 8 entries, so hit rates recover
without growing the cache size.

* Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp:
(WebCore::GradientRendererCG::makeGradientBySampling const):

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



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

Reply via email to