Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Slowroll:Base:1
nodejs-electron
bad-font-gc000.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bad-font-gc000.patch of Package nodejs-electron
Revert the following commit: commit 5ffa0446f51e34d06dc0539810a8a5d35ec9e3fc Author: Ian Kilpatrick <ikilpatrick@chromium.org> Date: Thu Feb 22 17:08:22 2024 +0000 [fonts][perf] Explicitly leak SimpleFontDatas via a LRU cache. This adds a strong LRU cache to FontDataCache to retain the most recently used fonts. This covers the case where a large amount of DOM is destroyed, and previously we'd release all the font related objects if the GC kicked in. Speedometer3 appears to peak at ~75 objects in the cache. Results for different cache sizes: Cache size: 64 | 32 | 16 Speedometer3: +0.9% | +0.5% | +0% Bug: 41490008 Change-Id: I131b6a79f246e61e13a7d44dddbc1f9e625ed44a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314842 Reviewed-by: Dominik Röttsches <drott@chromium.org> Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/main@{#1264027} --- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc +++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc @@ -36,15 +36,6 @@ namespace blink { -namespace { - -// The maximum number of strong references to retain via the LRU. -// This explicitly leaks fonts (and related objects) unless under extreme -// memory pressure where it will be cleared. DO NOT increase unnecessarily. -const wtf_size_t kMaxSize = 64; - -} // namespace - const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, bool subpixel_ascent_descent) { if (!platform_data) @@ -64,16 +55,7 @@ const SimpleFontData* FontDataCache::Get add_result.stored_value->value = MakeGarbageCollected<SimpleFontData>( platform_data, nullptr, subpixel_ascent_descent); } - - const SimpleFontData* result = add_result.stored_value->value; - - // Update our LRU to keep a strong reference to `result`. - strong_reference_lru_.PrependOrMoveToFirst(result); - while (strong_reference_lru_.size() > kMaxSize) { - strong_reference_lru_.pop_back(); - } - - return result; + return add_result.stored_value->value; } } // namespace blink --- a/third_party/blink/renderer/platform/fonts/font_data_cache.h +++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h @@ -34,7 +34,6 @@ #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" -#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" namespace blink { @@ -59,29 +58,17 @@ class FontDataCache final { FontDataCache(const FontDataCache&) = delete; FontDataCache& operator=(const FontDataCache&) = delete; - void Trace(Visitor* visitor) const { - visitor->Trace(cache_); - visitor->Trace(strong_reference_lru_); - } + void Trace(Visitor* visitor) const { visitor->Trace(cache_); } const SimpleFontData* Get(const FontPlatformData*, bool subpixel_ascent_descent = false); - void Clear() { - cache_.clear(); - strong_reference_lru_.clear(); - } + void Clear() { cache_.clear(); } private: HeapHashMap<Member<const FontPlatformData>, WeakMember<const SimpleFontData>, FontDataCacheKeyHashTraits> cache_; - - // The above `cache_` is weak, meaning its entries will potentially be - // cleared if no other references exist. - // This LRU keeps a small (limited) number of strong references alive so they - // won't be cleared in the above cache for performance reasons. - HeapLinkedHashSet<Member<const SimpleFontData>> strong_reference_lru_; }; } // namespace blink
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor