Bug 141051

Summary: Store MemoryCache's live decoded resources in a ListHashSet
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Page LoadingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, japhet, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 141292    
Bug Blocks:    
Attachments:
Description Flags
Patch koivisto: review+

Chris Dumez
Reported 2015-01-29 14:41:15 PST
Store MemoryCache's live decoded resources in a ListHashSet instead of a linked list. The frequent operations are: 1. Add items to one end 2. Remove items from the other end or anywhere in the container by value Using a ListHashSet instead of a manual linked list results in *much* simpler code and is fast for all operations (faster than linked list even for removing an given element from the linked list given its value). The current implementation requires us to keep a lot of pointers up-to-date, which is error prone. This is a first step towards simplifying the MemoryCache implementation.
Attachments
Patch (11.44 KB, patch)
2015-01-29 14:48 PST, Chris Dumez
koivisto: review+
Chris Dumez
Comment 1 2015-01-29 14:48:45 PST
Antti Koivisto
Comment 2 2015-01-30 02:03:00 PST
Comment on attachment 245653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245653&action=review > Source/WebCore/loader/cache/MemoryCache.h:142 > + bool inLiveDecodedResourcesList(CachedResource* resource) const { return m_liveDecodedResources.contains(resource); } It would be nicer to take a reference.
Chris Dumez
Comment 3 2015-01-30 09:40:48 PST
Note You need to log in before you can comment on or make changes to this bug.