RESOLVED FIXED141051
Store MemoryCache's live decoded resources in a ListHashSet
https://bugs.webkit.org/show_bug.cgi?id=141051
Summary Store MemoryCache's live decoded resources in a ListHashSet
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.