Bug 141110

Summary: Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Page LoadingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, japhet, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=231117
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2015-01-30 22:45:51 PST
Use simpler CachedResourceMap structure in Memory with CACHE_PARTITIONING enabled. Previously, we would be using a HashMap of HashMap to store CachedResources. The outer HashMap would use the URL as key and the inner HashMap using the partition name as key. This would make traversing the structure overly complicated, especially considering that the code needs to traverse a simple HashMap if CACHE_PARTITIONING is disabled.

This patch updates the CachedResourceMap structure to be a simple HashMap, whose key is an std::pair<URL, String /* partitionName */>. Having a flat structure simplifies the traversal code a lot and enables more code sharing between CACHE_PARTITIONING and !CACHE_PARTITIONING. This shouldn't regress performance because we already have both a URL and a partition name when we need to look up a resource. We never need to retrieve all resources with a particular URL.
Comment 1 Chris Dumez 2015-01-30 22:52:11 PST
Created attachment 245773 [details]
Patch
Comment 2 Chris Dumez 2015-01-31 13:17:05 PST
Created attachment 245796 [details]
Patch
Comment 3 Chris Dumez 2015-01-31 13:18:53 PST
Created attachment 245797 [details]
Patch
Comment 4 Antti Koivisto 2015-01-31 18:33:53 PST
Comment on attachment 245797 [details]
Patch

nice
Comment 5 WebKit Commit Bot 2015-01-31 19:11:12 PST
Comment on attachment 245797 [details]
Patch

Clearing flags on attachment: 245797

Committed r179456: <http://trac.webkit.org/changeset/179456>
Comment 6 WebKit Commit Bot 2015-01-31 19:11:22 PST
All reviewed patches have been landed.  Closing bug.