forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -33,8 +33,6 @@
|
||||
|
||||
#include "watchdata.h"
|
||||
|
||||
#include <utils/treemodel.h>
|
||||
|
||||
#include <QVector>
|
||||
|
||||
namespace Debugger {
|
||||
@@ -46,44 +44,6 @@ class WatchModel;
|
||||
|
||||
typedef QVector<DisplayFormat> DisplayFormats;
|
||||
|
||||
class WatchItem : public Utils::TreeItem, public WatchData
|
||||
{
|
||||
public:
|
||||
WatchItem() {}
|
||||
WatchItem(const QByteArray &i, const QString &n);
|
||||
explicit WatchItem(const WatchData &data);
|
||||
explicit WatchItem(const GdbMi &data);
|
||||
|
||||
void fetchMore();
|
||||
|
||||
QString displayName() const;
|
||||
QString displayType() const;
|
||||
QString displayValue() const;
|
||||
QString formattedValue() const;
|
||||
QString expression() const;
|
||||
|
||||
int itemFormat() const;
|
||||
|
||||
QVariant editValue() const;
|
||||
int editType() const;
|
||||
QColor valueColor(int column) const;
|
||||
|
||||
int requestedFormat() const;
|
||||
WatchItem *findItem(const QByteArray &iname);
|
||||
|
||||
private:
|
||||
WatchItem *parentItem() const;
|
||||
const WatchModel *watchModel() const;
|
||||
WatchModel *watchModel();
|
||||
DisplayFormats typeFormatList() const;
|
||||
|
||||
bool canFetchMore() const;
|
||||
QVariant data(int column, int role) const;
|
||||
Qt::ItemFlags flags(int column) const;
|
||||
|
||||
void parseWatchData(const GdbMi &input);
|
||||
};
|
||||
|
||||
class WatchModelBase : public Utils::TreeModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user