RESOLVED FIXED 143857
Use less memory when compiling content extensions
https://bugs.webkit.org/show_bug.cgi?id=143857
Summary Use less memory when compiling content extensions
Alex Christensen
Reported 2015-04-16 17:38:35 PDT
We keep a lot of things alive when compiling. Using less memory would start with keeping fewer things alive.
Attachments
Patch (3.71 KB, patch)
2015-04-16 17:39 PDT, Alex Christensen
no flags
Patch (4.92 KB, patch)
2015-04-16 17:58 PDT, Alex Christensen
no flags
Patch (4.79 KB, patch)
2015-04-16 18:02 PDT, Alex Christensen
benjamin: review+
Alex Christensen
Comment 1 2015-04-16 17:39:42 PDT
Benjamin Poulain
Comment 2 2015-04-16 17:46:36 PDT
Comment on attachment 250983 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250983&action=review Simon would like more info in the changelog. I don't like the "// Free memory.", they are not adding any information. > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:165 > + parsedRuleList = Vector<ContentExtensionRule>(); // Free memory. > + actionLocations = Vector<unsigned>(); // Free memory. Vector has clear(). A single comment on top of the two lines would be better. > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:179 > Vector<NFA> nfas = combinedURLFilters.createNFAs(); > if (!nfas.size() && universalActionLocations.size()) > nfas.append(NFA()); > + combinedURLFilters.clear(); // Free memory. I am unconvinced this is the right balance. We should look into generating the NFAs one by one out of the combinedURLFilters, generate its DFA, clear the NFA, generate the bytecode, clear the DFA. > Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:240 > + nfas = Vector<NFA>(); // Free memory. nfas.clear()?
Alex Christensen
Comment 3 2015-04-16 17:58:39 PDT
Alex Christensen
Comment 4 2015-04-16 18:02:23 PDT
Alex Christensen
Comment 5 2015-04-16 18:14:13 PDT
Note You need to log in before you can comment on or make changes to this bug.