RESOLVED FIXED146575
[Content Extensions] Make the DFA transitions ranges instead of characters
https://bugs.webkit.org/show_bug.cgi?id=146575
Summary [Content Extensions] Make the DFA transitions ranges instead of characters
Benjamin Poulain
Reported 2015-07-02 22:29:16 PDT
[Content Extensions] Make the DFA transitions ranges instead of characters
Attachments
Patch (126.92 KB, patch)
2015-07-02 22:51 PDT, Benjamin Poulain
no flags
Patch (126.92 KB, patch)
2015-07-02 23:19 PDT, Benjamin Poulain
no flags
Patch (126.87 KB, patch)
2015-07-03 19:02 PDT, Benjamin Poulain
no flags
Patch (125.92 KB, patch)
2015-07-06 11:50 PDT, Alex Christensen
achristensen: review+
Benjamin Poulain
Comment 1 2015-07-02 22:51:26 PDT
WebKit Commit Bot
Comment 2 2015-07-02 22:53:47 PDT
Attachment 256075 [details] did not pass style-queue: ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:41: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:42: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Benjamin Poulain
Comment 3 2015-07-02 23:19:22 PDT
WebKit Commit Bot
Comment 4 2015-07-02 23:20:57 PDT
Attachment 256078 [details] did not pass style-queue: ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:41: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:42: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 5 2015-07-03 11:12:13 PDT
Comment on attachment 256078 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256078&action=review > Source/WebCore/contentextensions/DFABytecodeCompiler.cpp:208 > + uint32 fallbackTransitionTarget = std::numeric_limits<uint32>::max(); uint32_t
Alex Christensen
Comment 6 2015-07-03 11:58:23 PDT
This reduces compile time from 22.4 to 6.9 seconds in a large test, reduces byte code size from 26.8MB to 25.3MB, and reduces DFA memory usage from ~32MB to ~6MB. Win Win Win!
Alex Christensen
Comment 7 2015-07-03 12:02:50 PDT
In another large test case, this reduces the compiling time from 5.8 to 4.4 seconds, but increases the byte code size from 14 to 19 MB.
Benjamin Poulain
Comment 8 2015-07-03 12:34:13 PDT
(In reply to comment #7) > In another large test case, this reduces the compiling time from 5.8 to 4.4 > seconds, but increases the byte code size from 14 to 19 MB. When comparing the final size, don't forget the previous minimizer was accidentally destroying information. The resulting DFA was not always correct. The new minimizer always find the smallest DFA and does not fuck up the fallback transition :) I have an idea to get back some of the size increase in the bytecode.
Benjamin Poulain
Comment 9 2015-07-03 19:02:47 PDT
WebKit Commit Bot
Comment 10 2015-07-03 19:04:50 PDT
Attachment 256125 [details] did not pass style-queue: ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:41: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:42: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 11 2015-07-06 11:50:23 PDT
WebKit Commit Bot
Comment 12 2015-07-06 11:52:26 PDT
Attachment 256227 [details] did not pass style-queue: ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:41: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] ERROR: Source/WebCore/contentextensions/DFACombiner.cpp:42: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 13 2015-07-06 11:53:01 PDT
Comment on attachment 256227 [details] Patch New patch for ews. Still reviewing minimizer.
Alex Christensen
Comment 14 2015-07-06 13:01:00 PDT
Comment on attachment 256227 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256227&action=review > Source/WebCore/contentextensions/DFAMinimizer.cpp:103 > + m_sets.append(SetDescriptor { start, size, 0 }); appendUnchecked? > Source/WebCore/contentextensions/DFAMinimizer.cpp:373 > + return 1; This seems a little strange. > Source/WebCore/contentextensions/DFANode.cpp:80 > + // Transitions can contains "0" if the expression has a end-of-line marker. "0" -> '\0'
Alex Christensen
Comment 15 2015-07-06 14:08:05 PDT
Alex Christensen
Comment 16 2015-10-29 20:48:42 PDT
*** Bug 146429 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.