Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KDevelop
KDevelop
Commits
bed56dbc
Commit
bed56dbc
authored
Apr 04, 2012
by
Milian Wolff
Browse files
add benchmark that tests performance of makeoutputmodel for really long linker lines
it fails currently
CCBUG: 295361
parent
7e6c2e68
Changes
2
Hide whitespace changes
Inline
Side-by-side
projectbuilders/makebuilder/tests/test_makeoutputmodel.cpp
View file @
bed56dbc
...
...
@@ -69,4 +69,48 @@ void TestMakeOutputModel::benchAddLines()
QVERIFY
(
avgUiLockup
<
200
);
}
void
TestMakeOutputModel
::
benchAddLongLine
()
{
// see also: https://bugs.kde.org/show_bug.cgi?id=295361
const
int
objects
=
100
;
// *.o files
const
int
libs
=
20
;
// -l...
const
int
libPaths
=
20
;
// -L...
QString
line
=
"g++ -m64 -Wl,-rpath,/home/gabo/md/qt/lib -o bin/flap_ui"
;
for
(
int
i
=
0
;
i
<
objects
;
++
i
)
{
line
+=
QString
(
" .obj/file%1.o"
).
arg
(
i
);
}
for
(
int
i
=
0
;
i
<
libPaths
;
++
i
)
{
line
+=
QString
(
" -Lsome/path/to/lib%1"
).
arg
(
i
);
}
for
(
int
i
=
0
;
i
<
libs
;
++
i
)
{
line
+=
QString
(
" -lsomelib%1"
).
arg
(
i
);
}
MakeOutputModel
model
(
KUrl
(
"/tmp/build-foo"
));
qRegisterMetaType
<
QModelIndex
>
(
"QModelIndex"
);
QSignalSpy
spy
(
&
model
,
SIGNAL
(
rowsAboutToBeInserted
(
QModelIndex
,
int
,
int
)));
QElapsedTimer
totalTime
;
totalTime
.
start
();
QStringList
lines
;
lines
<<
line
;
QBENCHMARK
{
model
.
addLines
(
lines
);
while
(
model
.
rowCount
()
!=
lines
.
count
())
{
QCoreApplication
::
instance
()
->
processEvents
();
}
}
QVERIFY
(
model
.
rowCount
()
==
lines
.
count
());
const
qint64
elapsed
=
totalTime
.
elapsed
();
qDebug
()
<<
"ms elapsed to add lines: "
<<
elapsed
;
qDebug
()
<<
"total number of added lines: "
<<
lines
.
count
();
const
double
avgUiLockup
=
double
(
elapsed
)
/
spy
.
count
();
qDebug
()
<<
"average UI lockup in ms: "
<<
avgUiLockup
;
QVERIFY
(
avgUiLockup
<
200
);
}
#include "test_makeoutputmodel.moc"
projectbuilders/makebuilder/tests/test_makeoutputmodel.h
View file @
bed56dbc
...
...
@@ -31,6 +31,7 @@ public:
explicit
TestMakeOutputModel
(
QObject
*
parent
=
0
);
private
slots
:
void
benchAddLongLine
();
void
benchAddLines
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment