Summary: | Make XSSFilter go fast by adding a SuffixTree | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Barth <abarth> | ||||||
Component: | New Bugs | Assignee: | Adam Barth <abarth> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth, dbates, eric, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Other | ||||||||
OS: | OS X 10.5 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 49845 | ||||||||
Attachments: |
|
Description
Adam Barth
2011-02-03 00:45:40 PST
Created attachment 81038 [details]
Patch
Comment on attachment 81038 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81038&action=review > Source/WebCore/html/parser/XSSFilter.cpp:146 > + const size_t miniumLengthForSuffixTree = 512; // FIXME: Tune this parameter. How would we tune it? > Source/WebCore/html/parser/XSSFilter.cpp:183 > + m_decodedHTTPBodySuffixTree = adoptPtr(new SuffixTree<ASCIICodebook>(m_decodedHTTPBody, suffixTreeDepth)); No create? Comment on attachment 81038 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81038&action=review >> Source/WebCore/html/parser/XSSFilter.cpp:146 >> + const size_t miniumLengthForSuffixTree = 512; // FIXME: Tune this parameter. > > How would we tune it? Dunno. With some sort of benchmark. >> Source/WebCore/html/parser/XSSFilter.cpp:183 >> + m_decodedHTTPBodySuffixTree = adoptPtr(new SuffixTree<ASCIICodebook>(m_decodedHTTPBody, suffixTreeDepth)); > > No create? It's adoptPtr, not adoptRef. We could add a create method, but we don't usually. Created attachment 81134 [details]
Patch
Comment on attachment 81134 [details]
Patch
What's the perf improvement?
We can add these benchmarks to PerformanceTests/XSSFilter if you like. (In reply to comment #7) > We can add these benchmarks to PerformanceTests/XSSFilter if you like. I would very much like that. As is, there is too much hidden-knowledge around the filter. Adding the perf tests to a common place makes it easier for others to hack on this (and possibly make it even faster). Comment on attachment 81134 [details]
Patch
OK. I look forward to you landing the perf tests.
Committed r77560: <http://trac.webkit.org/changeset/77560> Perf test in https://bugs.webkit.org/show_bug.cgi?id=53741 http://trac.webkit.org/changeset/77560 might have broken GTK Linux 32-bit Release, GTK Linux 32-bit Debug, and GTK Linux 64-bit Debug The following tests are not passing: fast/events/pagehide-timeout.html |