[AdBlock] Improved performance of loading rules
Don't use regexps for parsing rules.
Added benchmark for loading subscriptions
Before:
********* Start testing of AdBlockParseRule *********
Config: Using QTest library 4.8.6, Qt 4.8.6
PASS : AdBlockParseRule::initTestCase()
RESULT : AdBlockParseRule::parseEasyList():
596.3 msecs per iteration (total: 2,982, iterations: 5)
PASS : AdBlockParseRule::parseEasyList()
PASS : AdBlockParseRule::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of AdBlockParseRule *********
After:
********* Start testing of AdBlockParseRule *********
Config: Using QTest library 4.8.6, Qt 4.8.6
PASS : AdBlockParseRule::initTestCase()
RESULT : AdBlockParseRule::parseEasyList():
481.8 msecs per iteration (total: 2,409, iterations: 5)
PASS : AdBlockParseRule::parseEasyList()
PASS : AdBlockParseRule::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of AdBlockParseRule *********
2014-04-06 13:34:01 +02:00
|
|
|
TEMPLATE = subdirs
|
|
|
|
|
|
|
|
defineTest(addSubdir) {
|
|
|
|
for(subdir, 1) {
|
|
|
|
entries = $$files($$subdir/*)
|
|
|
|
for(entry, entries) {
|
|
|
|
fullPath = $$replace(entry, ;,"")
|
|
|
|
fullPath = $$replace(fullPath, \\\\, /)
|
|
|
|
name = $$replace(fullPath, $$re_escape("$$subdir/"), "")
|
|
|
|
os2|win32: fullPath = $$lower($$fullPath)
|
|
|
|
exists($$fullPath/*.pro): SUBDIRS += $$fullPath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export (SUBDIRS)
|
|
|
|
}
|
|
|
|
|
2014-04-13 10:47:04 +02:00
|
|
|
addSubdir($$PWD)
|