Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QML_Benchmark
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Daniel Smith
QML_Benchmark
Commits
fe718255
Commit
fe718255
authored
Jan 03, 2019
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix version selector. Update animation durations to 30 sec. Remove machine-specific file paths.
parent
dd7998f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
benchmark.cpp
benchmark.cpp
+6
-8
benchmark.h
benchmark.h
+1
-1
main.qml
main.qml
+6
-6
No files found.
benchmark.cpp
View file @
fe718255
...
...
@@ -117,20 +117,18 @@ void Benchmark::finished(){
frametimesCS
+=
QString
::
number
(
static_cast
<
double
>
(
frametimes
[
i
]),
'f'
,
2
)
+
((
i
<
maxframes
-
1
)
?
","
:
""
);
}
qDebug
()
<<
"Frame times (ms):"
<<
frametimesCS
;
int
n
=
sizeof
(
frametimes
)
/
sizeof
(
frametimes
[
0
]);
int
runtime
=
std
::
accumulate
(
frametimes
,
frametimes
+
n
,
0
);
qDebug
()
<<
"Finished"
<<
maxframes
<<
"frames in"
<<
runtime
<<
"ms"
<<
"at"
<<
(
maxframes
*
1000
)
/
runtime
<<
"fps"
;
int
startuptime
=
static_cast
<
int
>
(
frametimes
[
0
]);
qDebug
()
<<
"Start-up time:"
<<
startuptime
<<
"ms"
;
float
meanFrametime
=
(
static_cast
<
float
>
(
runtime
)
-
startuptime
)
/
static_cast
<
float
>
(
maxframes
);
qDebug
()
<<
"Average Frame time:"
<<
QString
::
number
(
static_cast
<
double
>
(
meanFrametime
),
'f'
,
2
).
toFloat
()
<<
"ms"
;
frametimes
[
0
]
=
frametimes
[
1
];
// hack to omit start-up time from our standard deviation calcuation.
float
runtime
=
std
::
accumulate
(
frametimes
,
frametimes
+
maxframes
,
0.0
);
qDebug
()
<<
"Finished"
<<
maxframes
<<
"frames in"
<<
runtime
<<
"ms"
<<
"at"
<<
(
maxframes
*
1000
)
/
runtime
<<
"fps"
;
float
meanFrametime
=
static_cast
<
float
>
(
runtime
)
/
static_cast
<
float
>
(
maxframes
);
qDebug
()
<<
"Average Frame time:"
<<
QString
::
number
(
static_cast
<
double
>
(
meanFrametime
),
'f'
,
2
).
toFloat
()
<<
"ms"
;
qDebug
()
<<
""
;
frametimes
[
0
]
=
frametimes
[
1
];
// hack to omit start-up time from our standard deviation calcuation.
float
runtimeStdDev
=
calculateSD
(
frametimes
);
qDebug
()
<<
"Standard Deviation:"
<<
runtimeStdDev
;
// << "over" << maxframes << "frames";
qDebug
()
<<
"Coefficient of Variation:"
<<
(
runtimeStdDev
/
meanFrametime
)
*
100
;
...
...
benchmark.h
View file @
fe718255
...
...
@@ -26,7 +26,7 @@ class Benchmark: public QObject{
bool
beforeFirstFrame
=
true
;
int
frame
=
0
;
int
lastframetotal
;
static
const
int
maxframes
=
150
;
static
const
int
maxframes
=
150
0
;
float
frametimes
[
maxframes
];
//add 1 to allow space for the measurement taken before the QML application starts.
int
virtualMem
[(
maxframes
/
10
)
+
1
];
...
...
main.qml
View file @
fe718255
...
...
@@ -12,7 +12,7 @@ Window {
visible
:
true
property
int
pixelSize
:
mainView
.
height
/
8
property
string
textureExtension
:
Qt
.
application
.
version
===
"
5.6
"
?
"
.png
"
:
"
.ktx
"
property
string
textureExtension
:
Qt
.
application
.
version
===
"
5.6
"
||
"
5.9
"
?
"
.png
"
:
"
.ktx
"
function
fontSource
()
{
...
...
@@ -29,7 +29,7 @@ Window {
console
.
debug
(
s
+
suffix
)
return
"
file:
/home/dan/projects/Heavy_QML_example/
fonts/
"
+
s
+
suffix
+
"
.ttf
"
return
"
file:fonts/
"
+
s
+
suffix
+
"
.ttf
"
}
...
...
@@ -62,7 +62,7 @@ Window {
source
:
background
radius
:
64
Behavior
on
radius
{
NumberAnimation
{
duration
:
1
000
}
NumberAnimation
{
duration
:
30
000
}
}
}
HueSaturation
{
...
...
@@ -74,7 +74,7 @@ Window {
NumberAnimation
on
hue
{
from
:
-
1.0
to
:
1
duration
:
1
0000
duration
:
3
0000
}
}
...
...
@@ -92,13 +92,13 @@ Window {
ColorAnimation
on
color
{
from
:
"
black
"
to
:
"
#42f450
"
duration
:
5
000
duration
:
30
000
}
OpacityAnimator
on
opacity
{
from
:
0.1
to
:
0.5
running
:
true
duration
:
5
000
duration
:
30
000
}
}
...
...
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