summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-12-16 17:17:38 +0100
committerhjk <hjk@theqtcompany.com>2016-01-06 09:59:11 +0000
commit7de7eb6bcada805eff176634e8131c4914e1213d (patch)
tree9893e071ca0f6e221760ba9a51e9a0daae24d28a /tests
parent768b775f5254021b1f4c803abb06ab0eb40e748b (diff)
downloadqt-creator-7de7eb6bcada805eff176634e8131c4914e1213d.tar.gz
Debugger: Work on WatchModel performance
Don't instantiate repeating boilerplate item data in some cases (such as large arrays). This makes it necessary to access parent WatchItems in a lot more cases than before and needs another separation of WatchItem/WatchModel code to keep the dumper autotests in a functional state. For a plain std::vector<int> with 1 mio items this reduces extraction time from more than 2 minutes to about 3 seconds. Change-Id: I175c5f6ee90434a6e85342d8bb71bd10a04dd271 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/debugger/dumpers.pro4
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp83
2 files changed, 44 insertions, 43 deletions
diff --git a/tests/auto/debugger/dumpers.pro b/tests/auto/debugger/dumpers.pro
index 9664d0cb11..3a44baea6d 100644
--- a/tests/auto/debugger/dumpers.pro
+++ b/tests/auto/debugger/dumpers.pro
@@ -1,8 +1,6 @@
QT = core network
-win32-msvc* {
- QTC_LIB_DEPENDS += utils
-}
+QTC_LIB_DEPENDS += utils
include(../qttest.pri)
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index cbb1d94fde..e84caff2d9 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -1425,62 +1425,65 @@ void tst_Dumpers::dumper()
GdbMi actual;
actual.fromString(contents);
- WatchData local;
+ WatchItem local;
local.iname = "local";
- QList<WatchData> list;
foreach (const GdbMi &child, actual.children()) {
- WatchData dummy;
- dummy.iname = child["iname"].data();
- dummy.name = QLatin1String(child["name"].data());
- if (dummy.iname == "local.qtversion")
+ const QByteArray iname = child["iname"].data();
+ if (iname == "local.qtversion")
context.qtVersion = child["value"].toInt();
- else if (dummy.iname == "local.gccversion")
+ else if (iname == "local.gccversion")
context.gccVersion = child["value"].toInt();
- else if (dummy.iname == "local.clangversion")
+ else if (iname == "local.clangversion")
context.clangVersion = child["value"].toInt();
- else if (dummy.iname == "local.boostversion")
+ else if (iname == "local.boostversion")
context.boostVersion = child["value"].toInt();
- else
- parseWatchData(dummy, child, &list);
+ else {
+ WatchItem *item = new WatchItem;
+ item->parse(child);
+ local.appendChild(item);
+ }
}
//qDebug() << "QT VERSION " << QByteArray::number(context.qtVersion, 16);
QSet<QByteArray> seenINames;
bool ok = true;
- foreach (const WatchData &item, list) {
- seenINames.insert(item.iname);
+
+ for (int i = data.checks.size(); --i >= 0; ) {
//qDebug() << "NUM CHECKS" << data.checks.size();
- for (int i = data.checks.size(); --i >= 0; ) {
- Check check = data.checks.at(i);
+ Check check = data.checks.at(i);
+ QByteArray iname = "local." + check.iname;
+ if (const WatchItem *item = local.findItem(iname)) {
+ seenINames.insert(iname);
//qDebug() << "CHECKS" << i << check.iname;
- if ("local." + check.iname == item.iname) {
- data.checks.removeAt(i);
- if (check.matches(m_debuggerEngine, m_debuggerVersion, context)) {
- //qDebug() << "USING MATCHING TEST FOR " << item.iname;
- if (!check.expectedName.matches(item.name.toLatin1(), context)) {
- qDebug() << "INAME : " << item.iname;
- qDebug() << "NAME ACTUAL : " << item.name.toLatin1();
- qDebug() << "NAME EXPECTED: " << check.expectedName.name;
- ok = false;
- }
- if (!check.expectedValue.matches(item.value, context)) {
- qDebug() << "INAME : " << item.iname;
- qDebug() << "VALUE ACTUAL : " << item.value << toHex(item.value);
- qDebug() << "VALUE EXPECTED: "
- << check.expectedValue.value << toHex(check.expectedValue.value);
- ok = false;
- }
- if (!check.expectedType.matches(item.type, context)) {
- qDebug() << "INAME : " << item.iname;
- qDebug() << "TYPE ACTUAL : " << item.type;
- qDebug() << "TYPE EXPECTED: " << check.expectedType.type;
- ok = false;
- }
- } else {
- qDebug() << "SKIPPING NON-MATCHING TEST FOR " << item.iname;
+ data.checks.removeAt(i);
+ if (check.matches(m_debuggerEngine, m_debuggerVersion, context)) {
+ //qDebug() << "USING MATCHING TEST FOR " << iname;
+ QByteArray name = item->realName().toLatin1();
+ QByteArray type = item->type;
+ if (!check.expectedName.matches(name, context)) {
+ qDebug() << "INAME : " << iname;
+ qDebug() << "NAME ACTUAL : " << name;
+ qDebug() << "NAME EXPECTED: " << check.expectedName.name;
+ ok = false;
+ }
+ if (!check.expectedValue.matches(item->value, context)) {
+ qDebug() << "INAME : " << iname;
+ qDebug() << "VALUE ACTUAL : " << item->value << toHex(item->value);
+ qDebug() << "VALUE EXPECTED: " << check.expectedValue.value << toHex(check.expectedValue.value);
+ ok = false;
+ }
+ if (!check.expectedType.matches(type, context)) {
+ qDebug() << "INAME : " << iname;
+ qDebug() << "TYPE ACTUAL : " << type;
+ qDebug() << "TYPE EXPECTED: " << check.expectedType.type;
+ ok = false;
}
+ } else {
+ qDebug() << "SKIPPING NON-MATCHING TEST FOR " << iname;
}
+ } else {
+ qDebug() << "NOT SEEN: " << check.iname;
}
}