RESOLVED FIXED 153910
Clean up Blob code
https://bugs.webkit.org/show_bug.cgi?id=153910
Summary Clean up Blob code
Alex Christensen
Reported 2016-02-04 21:28:28 PST
Clean up Blob code
Attachments
Patch (16.88 KB, patch)
2016-02-04 21:37 PST, Alex Christensen
no flags
Patch (22.80 KB, patch)
2016-02-04 22:42 PST, Alex Christensen
no flags
Patch (20.34 KB, patch)
2016-02-04 22:51 PST, Alex Christensen
ap: review+
ap: commit-queue-
Alex Christensen
Comment 1 2016-02-04 21:37:58 PST
Alex Christensen
Comment 2 2016-02-04 22:42:51 PST
Alex Christensen
Comment 3 2016-02-04 22:51:30 PST
Alexey Proskuryakov
Comment 4 2016-02-04 23:01:09 PST
Comment on attachment 270737 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=270737&action=review > Source/WebCore/fileapi/Blob.h:79 > +#ifndef NDEBUG If this is for assertions only, then it should be using ASSERT_DISABLED macro (name from memory). > Source/WebCore/platform/network/BlobRegistry.h:69 > + virtual ~BlobRegistry() { }; This is not an improvement - constructors and destructors of polymorphic classes should not be inline, because of code size bloat. > Source/WebCore/platform/network/BlobRegistryImpl.cpp:78 > + return nullptr; Does return value optimization work in functions with multiple exit points? > Source/WebCore/platform/network/BlobRegistryImpl.h:70 > + HashMap<URL, RefPtr<BlobData>> m_blobs; Why is this better? URL is a large object. Do we waste time reparsing them later?
Alex Christensen
Comment 5 2016-02-05 08:46:15 PST
Comment on attachment 270737 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=270737&action=review >> Source/WebCore/platform/network/BlobRegistryImpl.cpp:78 >> + return nullptr; > > Does return value optimization work in functions with multiple exit points? Yes. > Source/WebCore/platform/network/BlobRegistryImpl.cpp:149 > - if (!m_blobs.contains(part.url().string())) > + if (!m_blobs.contains(part.url())) > return; > - for (const BlobDataItem& item : m_blobs.get(part.url().string())->items()) > + for (const BlobDataItem& item : m_blobs.get(part.url())->items()) I am going to make this only lookup the url once in the HashMap, though. >> Source/WebCore/platform/network/BlobRegistryImpl.h:70 >> + HashMap<URL, RefPtr<BlobData>> m_blobs; > > Why is this better? URL is a large object. Do we waste time reparsing them later? I thought it was more clear, and we don't reparse them, but you're right: this is a memory regression.
Alex Christensen
Comment 6 2016-02-05 08:57:26 PST
Note You need to log in before you can comment on or make changes to this bug.