Bug 95450 - [Qt][WK2] REGRESSION(r127091): It made layout tests extremely slow
Summary: [Qt][WK2] REGRESSION(r127091): It made layout tests extremely slow
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks: 69541 96861
  Show dependency treegraph
 
Reported: 2012-08-30 05:51 PDT by Csaba Osztrogonác
Modified: 2014-02-03 03:22 PST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2012-08-30 05:51:44 PDT
runtime on x86-64 Linux Qt Release WebKit2 (Amazon EC2):
- before this patch: 15 mins, 18 secs - http://build.webkit.sed.hu/builders/x86-64%20Linux%20Qt%20Release%20WebKit2%20%28Amazon%20EC2%29/builds/8144
- after this patch: 37 mins, 56 secs - http://build.webkit.sed.hu/builders/x86-64%20Linux%20Qt%20Release%20WebKit2%20%28Amazon%20EC2%29/builds/8145

runtime on x86-32 Linux Qt Release WebKit2  bot:
- before this patch: 22 mins, 59 secs - http://build.webkit.sed.hu/builders/x86-32%20Linux%20Qt%20Release%20WebKit2/builds/28318
- after this patch: 4 hrs, 58 mins, 29 secs - http://build.webkit.sed.hu/builders/x86-32%20Linux%20Qt%20Release%20WebKit2/builds/28319

Could you check what happened?
Comment 1 Luciano Wolf 2012-08-30 06:12:05 PDT
I'm investigating it: I suspect that some cache cleanup is happening between each test slowing down the whole test suite.
Comment 2 Csaba Osztrogonác 2012-08-30 09:38:28 PDT
Simon, what do you think, is it possible if it is related 
somehow to your similar JSC slowdown thing?

( https://trac.webkit.org/changeset/127091 made WK2 tests very slow. )
Comment 3 Luciano Wolf 2012-08-30 10:23:44 PDT
If the initialization/destruction of cache directories couldn't be avoided (even when tests doesn't have a manifest asking for appcache) and it causes this long delay we could turn it on only when needed. We could disable it at: 

Tools/WebKitTestRunner/TestController.cpp:
...
bool TestController::resetStateToConsistentValues() {
   ...
   WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, false);
   ...
}

and modify appcache related tests to use the same function as LayoutTests/http/tests/appcache/disabled.html uses, but setting it as true:

testRunner.overridePreference("WebKitOfflineWebApplicationCacheEnabled", true);


I'm a bit worried because it will affect all ports. GTK seems to take ~30min to run layouttests for WK2, but I don't know how powerful are their test machines. Otherwise could be another platform getting some benefit from this modification (as we were taking ~15min to run the tests).
Comment 4 Luciano Wolf 2012-08-30 12:40:21 PDT
(In reply to comment #3)

The last proposal doesn't work at all. I'm investigating another interesting path with setanta. When you run appcache tests you get new data to be written on your cache directory. If you clean it (right now we're doing a good & old "rm -rf")before running tests that doesn't use appcache they will run faster as before. So it seems a matter of wiping out all cache data before running other test.
Comment 5 Csaba Osztrogonác 2012-08-31 07:30:20 PDT
I skipped http/tests/appcache tests again until proper fix, because
2x- 12x longer testing time for several test unacceptable -
https://trac.webkit.org/changeset/127257
Comment 6 Simon Hausmann 2012-08-31 07:39:18 PDT
(In reply to comment #2)
> Simon, what do you think, is it possible if it is related 
> somehow to your similar JSC slowdown thing?

As much as I'd like to, I'm don't think it is related. But 2x-12x is quite drastic. 

Luciano, I suggest to start the http manually (there's a script for that in Tools/Scripts) and then valgrind --tool=callgrind DRT /path/to/a/single/appcache test to see if anything shows up.
Comment 7 Luciano Wolf 2012-09-03 11:04:49 PDT
It seems to be related to SQL database + Mutex usage. In the function:

int SQLiteStatement::prepare() (/Source/WebCore/platform/SQLiteStatement.cpp) 

there is a sqlite3Handle() to get back a sqlite3 object:

error = sqlite3_prepare16_v2(m_database.sqlite3Handle(), m_query.charactersWithNullTermination(), -1, &m_statement, &tail);

If I return a "0" from sqlite3Handle() the tests run faster as before. I'm managing to compile a GTK version to be able to compare testing timings.
Comment 8 Luciano Wolf 2012-09-03 12:09:06 PDT
GTK tests also face the same speed reduction. So fixing this issue could provide a speed boost in other platforms too.
Comment 9 Zan Dobersek 2012-09-03 23:22:56 PDT
This problem reminds me of bug #70699.

(In reply to comment #8)
> GTK tests also face the same speed reduction. So fixing this issue could provide a speed boost in other platforms too.

The GTK 64-bit WK2 bot is underpowered, plus the tests are at the moment badly gardened for that platform. Still, the tests in http/tests/appcache are fast enough:
http://test-results.appspot.com/dashboards/treemap.html#group=%40ToT%20-%20webkit.org&treemapfocus=LayoutTests%2Fhttp%2Ftests%2Fappcache&builder=GTK%20Linux%2064-bit%20Release%20WK2%20(Tests)
Comment 10 Luciano Wolf 2012-09-10 07:06:23 PDT
I've tried this GTK approach but the problem persists. The ApplicationCache.db file is created as soon as we have http/tests/appcache tests running. From this point (appcache tests run at the very beginning of test suite) the ApplicationCache.db will be there until all the tests are processed slowing them all. I think the cache directory should be something temporary that could be erased between each test. This is not possible nowadays because we can have multiple tests running simultaneously. Each test should have it's own temporary path. As it is pointed in the link for bug#70699 the proper solution could came after we have a function to set cache patch implemented in WebKitWebContext. Also removing myself from "Assigned To:".
Comment 11 Jocelyn Turcotte 2014-02-03 03:22:21 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.