Bug 36694

Summary: Make XSSAuditor go fast with large POST data
Product: WebKit Reporter: Adam Barth <abarth>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dbates, jamesr, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://webblaze.org/abarth/tests/slow-filter/webkit-test-5.php
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Adam Barth 2010-03-27 00:24:48 PDT
This bug is a followup to https://bugs.webkit.org/show_bug.cgi?id=35373.  In that bug, we got within a factor of four of the auditor-disabled speed.  In this bug, we're going do a lot better in this benchmark.

I've hosted the benchmark here for convenience:
http://webblaze.org/abarth/tests/slow-filter/webkit-test-5.php
Comment 1 Adam Barth 2010-03-27 00:25:46 PDT
I hate git.  I just deleted all my work.  :(
Comment 2 Adam Barth 2010-03-27 00:28:27 PDT
TextMate, however, is awesome and recovered all my code.
Comment 3 Adam Barth 2010-03-27 00:37:43 PDT
Created attachment 51817 [details]
Patch
Comment 4 WebKit Review Bot 2010-03-27 00:39:43 PDT
Attachment 51817 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/page/XSSAuditor.h:37:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Adam Barth 2010-03-27 00:43:57 PDT
Comment on attachment 51817 [details]
Patch

Will fix some nits.
Comment 6 Adam Barth 2010-03-27 01:04:56 PDT
Created attachment 51818 [details]
Patch
Comment 7 Adam Barth 2010-03-27 01:07:52 PDT
Here are some run times for that benchmark:

XSSAuditor enabled:
1562
1531
1652

XSSAuditor disabled:
1525
1538
1571

I ran it a bunch more times, and anecdotally the benchmark seemed to have higher variance than these number.  However, I didn't keep records, so it's hard to draw conclusions.

In any case, the overhead is much smaller (even in this pathological case) using the suffix tree.
Comment 8 WebKit Review Bot 2010-03-27 01:10:21 PDT
Attachment 51818 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/page/XSSAuditor.h:37:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Daniel Bates 2010-04-01 22:32:57 PDT
Comment on attachment 51818 [details]
Patch

I would suggest adding SuffixTree to the Xcode project code for consistency with the changes to the other projects files even though the Mac EWS does not report any issues.

Looks good to me.

r=me
Comment 10 Adam Barth 2010-04-02 00:36:45 PDT
Created attachment 52398 [details]
Patch for landing
Comment 11 WebKit Commit Bot 2010-04-02 02:00:59 PDT
Comment on attachment 52398 [details]
Patch for landing

Clearing flags on attachment: 52398

Committed r56991: <http://trac.webkit.org/changeset/56991>
Comment 12 WebKit Commit Bot 2010-04-02 02:01:04 PDT
All reviewed patches have been landed.  Closing bug.