Bug 188791

Summary: [Linux] Cache the memory footprint and only update it after 1 second
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, bugs-noreply, cdumez, cmarcelo, dbates, ews-watchlist, saam, webkit-bug-importer, ysuzuki, zan
Priority: P2 Keywords: Gtk, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=188787
Attachments:
Description Flags
Patch ysuzuki: review+

Description Carlos Garcia Campos 2018-08-21 05:58:32 PDT
Getting the memory footprint is an expensive operation in Linux. When called multiple times, the CPU usage is too much (see bug #188787). We could cache the result for at least 1 second to ensure we don't call it more than once per second.
Comment 1 Carlos Garcia Campos 2018-08-21 06:02:18 PDT
Created attachment 347635 [details]
Patch
Comment 2 Yusuke Suzuki 2018-08-21 06:13:26 PDT
Comment on attachment 347635 [details]
Patch

r=me
Comment 3 Carlos Garcia Campos 2018-08-21 06:27:52 PDT
Committed r235113: <https://trac.webkit.org/changeset/235113>
Comment 4 Radar WebKit Bug Importer 2018-08-21 06:28:24 PDT
<rdar://problem/43558827>
Comment 5 Saam Barati 2018-08-21 19:47:45 PDT
1 second is a long time!
Comment 6 Carlos Garcia Campos 2018-08-21 23:20:19 PDT
I tried with lower values but cpu usage was still too much and tests were timing out. It seems RenderLayerCompositor::cacheAcceleratedCompositingFlags() is called too often.