Bug 224088

Summary: Make sure service workers use a ScriptSourceCode backed by file-mapped memory when possible
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Service WorkersAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, simon.fraser, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 224092, 224110    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
ews-feeder: commit-queue-
WIP Patch
ews-feeder: commit-queue-
WIP Patch
ews-feeder: commit-queue-
WIP Patch
none
WIP Patch
none
Patch none

Description Chris Dumez 2021-04-01 17:42:08 PDT
Make sure service workers use a ScriptSourceCode backed by file-mapped memory whenever possible. This saves dirty memory in the WebProcess.
Comment 1 Chris Dumez 2021-04-01 17:48:02 PDT
Created attachment 424969 [details]
WIP Patch

Needs polish but with this patch, warm memory usage on my service worker test case with ~200MB of scripts, the WebContent memory usage goes from 231MB to ~23MB.
The patch does not take care of the cold case yet.
Comment 2 Chris Dumez 2021-04-02 12:14:09 PDT
Created attachment 425039 [details]
WIP Patch
Comment 3 Chris Dumez 2021-04-02 13:18:57 PDT
Created attachment 425046 [details]
WIP Patch

The patch should now work in both the warm and cold cases. However, I am waiting for the dependency patch to land before I rebase & clean it up.
Comment 4 Chris Dumez 2021-04-02 14:32:54 PDT
Created attachment 425055 [details]
WIP Patch
Comment 5 Chris Dumez 2021-04-02 16:11:48 PDT
Created attachment 425063 [details]
WIP Patch
Comment 6 Chris Dumez 2021-04-02 17:16:21 PDT
Created attachment 425071 [details]
Patch
Comment 7 Yusuke Suzuki 2021-04-05 11:38:08 PDT
Comment on attachment 425071 [details]
Patch

r=me
Comment 8 EWS 2021-04-05 18:05:30 PDT
Committed r275465: <https://commits.webkit.org/r275465>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425071 [details].
Comment 9 Radar WebKit Bug Importer 2021-04-05 18:07:07 PDT
<rdar://problem/76245819>