RESOLVED FIXED 215012
Optimize WebsiteDataStoreConfiguration::copy
https://bugs.webkit.org/show_bug.cgi?id=215012
Summary Optimize WebsiteDataStoreConfiguration::copy
Alex Christensen
Reported 2020-07-30 22:40:58 PDT
Optimize WebsiteDataStoreConfiguration::copy
Attachments
Patch (3.97 KB, patch)
2020-07-30 22:43 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2020-07-30 22:41:21 PDT
*** Bug 215011 has been marked as a duplicate of this bug. ***
Alex Christensen
Comment 2 2020-07-30 22:43:38 PDT
Alex Christensen
Comment 3 2020-07-30 22:43:41 PDT
EWS
Comment 4 2020-07-30 23:16:38 PDT
Committed r265134: <https://trac.webkit.org/changeset/265134> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405670 [details].
Brady Eidson
Comment 5 2020-07-31 00:17:28 PDT
This actually wasn't quite enough! Need to apply the flag to the WebsiteDataStore constructor as well: WebsiteDataStore::WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&& configuration, PAL::SessionID sessionID) : m_sessionID(sessionID) , m_resolvedConfiguration(WTFMove(configuration)) , m_configuration((m_resolvedConfiguration)->copy()) <-------Here I'll followup in the morning
Alex Christensen
Comment 6 2020-07-31 08:24:37 PDT
That calls WebsiteDataStoreConfiguration::copy() which benefits from this optimization.
Geoffrey Garen
Comment 7 2020-07-31 09:02:33 PDT
Comment on attachment 405670 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405670&action=review > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:36 > +enum class WillCopyPathsFromExistingConfiguration : bool { No, Yes }; What's important here is not necessarily that the paths came from some other configuration, but rather that the paths are already fully resolved -- right? If so, perhaps a better enum would be PathsAreFullyResolved { No, Yes }. Global knowledge of the code and logical deduction can tell us that a path from an existing configuration is a fully resolved path, but it is best if reading code doesn't require global knowledge or logical deduction.
Brady Eidson
Comment 8 2020-07-31 09:08:08 PDT
(In reply to Alex Christensen from comment #6) > That calls WebsiteDataStoreConfiguration::copy() which benefits from this > optimization. Yup I totally misread it late at night, we're good.
Alex Christensen
Comment 9 2020-07-31 10:27:44 PDT
What's really important here is that we don't do disk read and write operations during WebsiteDataStoreConfiguration::copy. This was one solution, but I think a better one would be do std::call_once in each of the WebsiteDataStore::default*Directory in WebsiteDataStoreCocoa.mm and remove this strange looking code from WebsiteDataStoreConfiguration. That's not urgent, though, because this bug is fixed and we don't touch WebsiteDataStoreConfiguration much.
Note You need to log in before you can comment on or make changes to this bug.