Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QML_Benchmark
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Smith
QML_Benchmark
Commits
fe718255
Commit
fe718255
authored
6 years ago
by
Daniel Smith
Browse files
Options
Downloads
Patches
Plain Diff
Fix version selector. Update animation durations to 30 sec. Remove machine-specific file paths.
parent
dd7998f7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
benchmark.cpp
+6
-8
6 additions, 8 deletions
benchmark.cpp
benchmark.h
+1
-1
1 addition, 1 deletion
benchmark.h
main.qml
+6
-6
6 additions, 6 deletions
main.qml
with
13 additions
and
15 deletions
benchmark.cpp
+
6
−
8
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
;
...
...
This diff is collapsed.
Click to expand it.
benchmark.h
+
1
−
1
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
];
...
...
This diff is collapsed.
Click to expand it.
main.qml
+
6
−
6
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
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment